gluon-packages/gluon/gluon-legacy/generate/lib/gluon/upgrade/core/legacy/011-gluon-network

23 lines
498 B
Bash
Executable File

#!/bin/sh
. /lib/functions.sh
. /lib/gluon/functions/sysconfig.sh
case "$(ar71xx_board_name)" in
tl-wr1043nd|\
tl-wdr3600|\
tl-wdr4300) # fix up duplicate mac addresses
local mainaddr=$(sysconfig primary_mac)
local oIFS="$IFS"; IFS=":"; set -- $mainaddr; IFS="$oIFS"
local b2mask=0x02
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