1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 02:51:50 +00:00

Detect network interface in every cases

This commit is contained in:
Ycarus 2018-08-31 15:47:20 +02:00
parent 84b2966d2b
commit 2f13420592

View file

@ -97,7 +97,7 @@ uci -q set network.lan.ip4table='lan'
# Create WAN interfaces
if [ "$(uci -q show network | grep wan1)" = "" ]; then
if [ -d /sys/class/net/wan ]; then
if [ -d /sys/class/net/wan ] || [ -n "$(ip link | grep ' wan:')" ]; then
uci -q batch <<-EOF
delete network.wan
EOF
@ -105,8 +105,8 @@ if [ "$(uci -q show network | grep wan1)" = "" ]; then
_setup_wan_interface wan2 wan on macvlan
_setup_macvlan wan1
_setup_macvlan wan2
elif [ -d /sys/class/net/eth1 ]; then
if [ -d /sys/class/net/eth2 ]; then
elif [ -d /sys/class/net/eth1 ] || [ -n "$(ip link | grep ' eth1:')" ]; then
if [ -d /sys/class/net/eth2 ] || [ -n "$(ip link | grep ' eth2:')" ]; then
_setup_wan_interface wan1 eth1 master
_setup_wan_interface wan2 eth2 on
else