forked from freifunk-franken/firmware
27 lines
777 B
Plaintext
Executable File
27 lines
777 B
Plaintext
Executable File
# fonera to slow?
|
|
sleep 10
|
|
|
|
# todo: all devices or only dir300 ?
|
|
if uci get network.mesh.macaddr
|
|
then
|
|
echo "MAC is set already"
|
|
else
|
|
BRMAC=$(awk '{ tolower($0); print }' /sys/class/net/br-mesh/address)
|
|
WLMAC=$(awk '{ tolower($0); print }' /sys/class/net/wlan0/address)
|
|
ETMAC=$(awk '{ tolower($0); print }' /sys/class/net/eth0/address)
|
|
|
|
if [ "$WLMAC" != "" ] && [ "$BRMAC" != "" ] && [ "$BRMAC" != "$ETMAC" ]; then
|
|
echo "Fixing wrong MAC on br-mesh"
|
|
uci set network.mesh.macaddr=$ETMAC
|
|
uci commit
|
|
ifconfig br-mesh hw ether $ETMAC
|
|
ifconfig br-mesh down
|
|
ifconfig br-mesh up
|
|
#wait before reboot to generate tinc certificates and to be able
|
|
#to login over ssh bevore reboot in case of errors
|
|
fi
|
|
fi
|
|
|
|
batctl if add wlan0-1
|
|
|