diff --git a/package/gluon-core/files/lib/gluon/upgrade/core/initial/001-sysconfig b/package/gluon-core/files/lib/gluon/upgrade/core/initial/001-sysconfig index 1bcedc3a..36cdffdb 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/core/initial/001-sysconfig +++ b/package/gluon-core/files/lib/gluon/upgrade/core/initial/001-sysconfig @@ -15,7 +15,14 @@ get_primary_mac() { esac } +lan_ifname="$(uci get network.lan.ifname)" +wan_ifname="$(uci get network.wan.ifname)" + +if [ -n "$wan_ifname" ]; then + [ -z "$lan_ifname" ] || sysconfig_set lan_ifname "$lan_ifname" + sysconfig_set wan_ifname "$wan_ifname" +else + sysconfig_set wan_ifname "$lan_ifname" +fi -sysconfig_set lan_ifname "$(uci get network.lan.ifname)" -sysconfig_set wan_ifname "$(uci get network.wan.ifname)" sysconfig_set primary_mac "$(get_primary_mac)" diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/initial/010-mesh b/package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/initial/010-mesh index 6fca7533..12aea75e 100755 --- a/package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/initial/010-mesh +++ b/package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/initial/010-mesh @@ -3,9 +3,16 @@ . /lib/functions.sh . /lib/gluon/functions/sysconfig.sh +lan_ifname="$(sysconfig lan_ifname)" uci_add network interface client -uci_set network client ifname "$(sysconfig lan_ifname) bat0" + +if [ -n "$lan_ifname" ]; then + uci_set network client ifname "$lan_ifname bat0" +else + uci_set network client ifname "bat0" +fi + uci_set network client type 'bridge' uci_set network client proto 'dhcpv6' uci_set network client reqprefix 'no'