firmware/bsp/wr1043nd/root_file_system/etc/rc.local
2013-09-09 11:07:16 +00:00

51 lines
1.4 KiB
Plaintext
Executable File

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
# collect environment info and write to dot-script
/etc/environment.sh > /tmp/environment
#Set Mac-Addr of wr1043nd wifi interface if not right
#HARDWARE_MACADDR=`ifconfig -a wlan0 | grep 'HWaddr' | awk '{ print $5}'`
#SOFTWARE_MACADDR=`uci get wireless.@wifi-device[0].macaddr`
#
#if [[ "$HARDWARE_MACADDR" != "$SOFTWARE_MACADDR" ]]; then
# uci set wireless.@wifi-device[0].macaddr=$HARDWARE_MACADDR
# uci commit
# #wait before reboot to generate tinc certificates and to be able
# #to login over ssh bevore reboot in case of errors
# sleep 30
# reboot
#fi
if uci get network.ethmesh.macaddr
then
echo "MAC for ETH-BATMAN is set already"
else
echo "Fixing MAC on eth0.3 (ethmesh)"
NEW=$(awk -F: '{ printf("%02x:%02x:%02x:%02x:%02x:%02x\n", ("0x"$1)+2, "0x"$2, "0x"$3, "0x"$4, "0x"$5, "0x"$6 ) }' /sys/class/net/eth0/address)
uci set network.ethmesh.macaddr=$NEW
uci commit
ifconfig eth0.3 hw ether $NEW
ifconfig eth0.3 down
ifconfig eth0.3 up
fi
batctl if add wlan0-1
batctl if add eth0.3
# Starting NTP-Client Daemon
ntpd -p "fe80::201:2ff:fe03:405%br-mesh"
. /etc/firewall.user
/etc/init.d/qos disable
/etc/init.d/qos stop
#busybox-httpd for crawldata
mkdir /tmp/crawldata
httpd -h /tmp/crawldata
#sh /etc/configurator.sh
exit 0