contrib/freifunk-policyrouting: Fix getting the name of interfaces
This commit is contained in:
parent
9ffd17e920
commit
c35bdaf847
1 changed files with 5 additions and 1 deletions
|
@ -46,7 +46,11 @@ if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then
|
||||||
if [ "`uci -q get network.$int.type`" == "bridge" ]; then
|
if [ "`uci -q get network.$int.type`" == "bridge" ]; then
|
||||||
dev="br-$int"
|
dev="br-$int"
|
||||||
else
|
else
|
||||||
dev=`uci get network.$int.ifname`
|
if [ -n "`uci -p /var/state get network.$int.ifname`" ]; then
|
||||||
|
dev=`uci -p /var/state get network.$int.ifname`
|
||||||
|
else
|
||||||
|
dev=`uci -p /var/state get network.$int.device`
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
logger -t policyrouting "Add mark 1 to packages coming in via interface $dev"
|
logger -t policyrouting "Add mark 1 to packages coming in via interface $dev"
|
||||||
iptables -t mangle -I prerouting_policy -i $dev -j MARK --set-mark 1
|
iptables -t mangle -I prerouting_policy -i $dev -j MARK --set-mark 1
|
||||||
|
|
Loading…
Reference in a new issue