gluon-packages/gluon/gluon-core/files/lib/gluon/upgrade/core/initial/011-gluon-network

29 lines
559 B
Bash
Executable File

#!/bin/sh
. /lib/functions.sh
. /lib/gluon/functions/sysconfig.sh
uci_remove network lan
uci_set network wan type 'bridge'
uci_set network wan proto 'dhcp'
EOF
mainaddr=$(sysconfig primary_mac)
oIFS="$IFS"; IFS=":"; set -- $mainaddr; IFS="$oIFS"
b2mask=0x02
case "$board" in
tl-wr1043nd|\
tl-wdr3600|\
tl-wdr4300) # fix up duplicate mac addresses
local wanaddr=$(printf "%02x:%s:%s:%02x:%s:%02x" $(( 0x$1 | $b2mask )) $2 $3 $(( (0x$4 + 1) % 0x100 )) $5 $(( (0x$6 + 1) % 0x100 )) )
uci_set network wan macaddr "$wanaddr"
;;
esac
uci_commit network