Add hop_penalty.sh

This commit is contained in:
Alexander 2020-04-19 16:26:14 +02:00 committed by GitHub
parent e985d56db8
commit c04b5b8b25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

9
hop_penalty.sh Normal file
View file

@ -0,0 +1,9 @@
# No uci support for hop penalty after Gluon v2019.1.2
INTERFACE="bat0"
PENALTY="5"
CURRENT=$(cat /sys/class/net/$INTERFACE/mesh/hop_penalty)
if [ "$PENALTY" != "$CURRENT" ]; then
echo $PENALTY > /sys/class/net/$INTERFACE/mesh/hop_penalty
uci set batman-adv.$INTERFACE.hop_penalty=$PENALTY
uci commit batman-adv
fi