Skip to content
Snippets Groups Projects
Commit bc1be304 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

More fixes for strange network interface configurations

parent f1fa2a29
No related branches found
No related tags found
No related merge requests found
...@@ -15,10 +15,15 @@ get_primary_mac() { ...@@ -15,10 +15,15 @@ get_primary_mac() {
esac esac
} }
iface_exists() {
local name="$1"
ip link show dev "${name//.*/}" >/dev/null 2>&1
}
lan_ifname="$(uci get network.lan.ifname)" lan_ifname="$(uci get network.lan.ifname)"
wan_ifname="$(uci get network.wan.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" [ -z "$lan_ifname" ] || sysconfig_set lan_ifname "$lan_ifname"
sysconfig_set wan_ifname "$wan_ifname" sysconfig_set wan_ifname "$wan_ifname"
else else
......
...@@ -7,7 +7,10 @@ ...@@ -7,7 +7,10 @@
uci_remove network lan 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 type 'bridge'
uci_set network wan proto 'dhcp' uci_set network wan proto 'dhcp'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment