contrib/freifunk-policyrouting: Fix getting the name of interfaces

This commit is contained in:
Manuel Munz 2011-09-22 13:14:22 +00:00
parent 9ffd17e920
commit c35bdaf847

View file

@ -46,7 +46,11 @@ if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then
if [ "`uci -q get network.$int.type`" == "bridge" ]; then
dev="br-$int"
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
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