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

29 lines
559 B
Plaintext
Raw Normal View History

#!/bin/sh
2013-10-03 18:46:54 +02:00
. /lib/functions.sh
. /lib/gluon/functions/sysconfig.sh
2013-10-03 18:46:54 +02:00
uci_remove network lan
2013-10-03 18:46:54 +02:00
uci_set network wan type 'bridge'
uci_set network wan proto 'dhcp'
EOF
2013-10-03 18:46:54 +02:00
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 )) )
2013-10-03 18:46:54 +02:00
uci_set network wan macaddr "$wanaddr"
;;
esac
2013-10-03 18:46:54 +02:00
uci_commit network