mirror of
https://github.com/MarkusMcNugen/docker-qBittorrentvpn
synced 2024-11-14 22:55:11 +00:00
Update iptables.sh
This commit is contained in:
parent
9a11dd2600
commit
a7b2734d23
@ -46,12 +46,11 @@ for lan_network_item in "${lan_network_list[@]}"; do
|
|||||||
echo "$int_cidr detected on $interface interface"
|
echo "$int_cidr detected on $interface interface"
|
||||||
|
|
||||||
# get default gateway of interfaces as looping through them
|
# get default gateway of interfaces as looping through them
|
||||||
DEFAULT_GATEWAY2=$(/sbin/ip route |grep '^default' | awk "/${interface}/ {print $3}")
|
DEFAULT_GATEWAYS=$(/sbin/ip route |grep '^default' | awk "/${interface}/ {print $3}")
|
||||||
|
|
||||||
# strip whitespace from start and end of lan_network_item
|
echo "${DEFAULT_GATEWAYS} gateway detected for ${interface} interface"
|
||||||
lan_network_item=$(echo "${lan_network_item}" | sed -e 's~^[ \t]*~~;s~[ \t]*$~~')
|
|
||||||
|
|
||||||
ip route add "${lan_network_item}" via "${DEFAULT_GATEWAY2}" dev ${interface}
|
ip route add "${lan_network_item}" via "${DEFAULT_GATEWAYS}" dev "${interface}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user