Properly support devices with only one ethernet interface
This commit is contained in:
parent
bb4a9fd5af
commit
b8820bab61
@ -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)"
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user