forked from freifunk-franken/firmware
45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
# SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
. /lib/functions.sh
|
|
. /lib/functions/system.sh
|
|
. /lib/functions/fff/network
|
|
|
|
BOARD="$(uci get board.model.name)"
|
|
|
|
case "$BOARD" in
|
|
tplink,archer-c7-v2|\
|
|
tplink,archer-c25-v1)
|
|
ETHMESHMAC=$(cat /sys/class/net/eth0/address)
|
|
;;
|
|
tplink,archer-c60-v1|\
|
|
tplink,archer-c60-v2)
|
|
ETHMESHMAC=$(cat /sys/class/net/eth1/address)
|
|
;;
|
|
glinet,gl-ar150|\
|
|
netgear,r6220|\
|
|
tplink,archer-c50-v3|\
|
|
tplink,archer-c50-v4)
|
|
ETHMESHMAC="$(macFlipLocalBit $(cat /sys/class/net/eth0/address))"
|
|
;;
|
|
tplink,archer-c7-v5|\
|
|
tplink,tl-wdr4900-v1)
|
|
# use mac address from phy1 with 'locally administered' bit set to '1'
|
|
# only possible, because wXmesh is created first and therefore gets the 'universally administered address'
|
|
ETHMESHMAC=$(macFlipLocalBit "$(cat /sys/class/ieee80211/phy1/macaddress)")
|
|
;;
|
|
tplink,tl-wdr3600-v1|\
|
|
tplink,tl-wdr4300-v1|\
|
|
tplink,tl-wdr4310-v1)
|
|
ETHMESHMAC=$(macaddr_add $(cat /sys/class/ieee80211/phy1/macaddress) 1)
|
|
;;
|
|
tplink,tl-wr1043nd-v4|\
|
|
tplink,tl-wr1043n-v5)
|
|
# Load second MAC address from flash because we haven't any interface with this
|
|
# address where we can copy it from
|
|
ETHMESHMAC=$(macaddr_add $(mtd_get_mac_binary info 8) 1)
|
|
;;
|
|
tplink,tl-wr841n-v13)
|
|
ETHMESHMAC=$(macaddr_setbit_la $(cat /sys/class/net/eth0/address))
|
|
;;
|
|
esac
|