Fonera: restore accidentally overwritten fonera mac fixes

Signed-off-by: Tim Niemeyer <tim.niemeyer@mastersword.de>
This commit is contained in:
Tim Niemeyer 2013-02-02 18:47:31 +01:00
parent 72b79cfb8c
commit ef071d695b
1 changed files with 12 additions and 11 deletions

View File

@ -14,6 +14,15 @@ toLower() {
echo $1 | sed -e "s/A/a/g" -e "s/B/b/g" -e "s/C/c/g" -e "s/D/d/g" -e "s/E/e/g" -e "s/F/f/g"
}
#. /etc/firewall.user
#busybox-httpd for crawldata
mkdir /tmp/crawldata
httpd -h /tmp/crawldata
# fonera to slow?
sleep 10
# todo: all devices or only dir300 ?
if uci get network.mesh.macaddr
then
@ -26,17 +35,15 @@ else
ETMAC=`ip link | grep eth0 -A1 | grep link | awk '{ print $2 }'`
ETMAC=`toLower $ETMAC`
if [ "$WLMAC" != "" ] && [ "$BRMAC" != "" ] && [ "$BRMAC" = "$ETMAC" ]; then
if [[ "$BRMAC" != "$WLMAC" ]]; then
if [ "$WLMAC" != "" ] && [ "$BRMAC" != "" ] && [ "$BRMAC" != "$ETMAC" ]; then
echo "Fixing wrong MAC on br-mesh"
uci set network.mesh.macaddr=$WLMAC
uci set network.mesh.macaddr=$ETMAC
uci commit
ifconfig br-mesh hw ether $WLMAC
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
fi
@ -44,10 +51,4 @@ fi
# uses to much ram
#ntpd -p "fe80::201:2ff:fe03:405%br-mesh"
#. /etc/firewall.user
#busybox-httpd for crawldata
mkdir /tmp/crawldata
httpd -h /tmp/crawldata
exit 0