More fixes for strange network interface configurations

This commit is contained in:
Matthias Schiffer 2014-01-22 22:04:08 +01:00
parent f1fa2a2971
commit bc1be30486
2 changed files with 9 additions and 1 deletions

View File

@ -15,10 +15,15 @@ get_primary_mac() {
esac
}
iface_exists() {
local name="$1"
ip link show dev "${name//.*/}" >/dev/null 2>&1
}
lan_ifname="$(uci get network.lan.ifname)"
wan_ifname="$(uci get network.wan.ifname)"
if [ -n "$wan_ifname" ]; then
if [ -n "$wan_ifname" ] && iface_exists "$wan_ifname"; then
[ -z "$lan_ifname" ] || sysconfig_set lan_ifname "$lan_ifname"
sysconfig_set wan_ifname "$wan_ifname"
else

View File

@ -7,7 +7,10 @@
uci_remove network lan
uci_remove network wan
uci_add network interface wan
uci_set network wan ifname "$(sysconfig wan_ifname)"
uci_set network wan type 'bridge'
uci_set network wan proto 'dhcp'