From 0cce4f911d5c6e8f0f07487a2913a3827f01a060 Mon Sep 17 00:00:00 2001 From: floh1111 Date: Sat, 5 Nov 2011 11:46:07 +0000 Subject: [PATCH] Improved the enable correct wifi fix for dir300 and set fixed mac address on wrt54gs mesh bridge --- root_file_system/default/etc/config/wireless | 2 ++ root_file_system/dir300/etc/sysctl.conf | 2 +- root_file_system/wrt54g_adhoc/etc/rc.local | 11 ++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/root_file_system/default/etc/config/wireless b/root_file_system/default/etc/config/wireless index f002a95..6668a66 100644 --- a/root_file_system/default/etc/config/wireless +++ b/root_file_system/default/etc/config/wireless @@ -4,6 +4,8 @@ config 'wifi-device' 'wifi0' option 'channel' '6' option 'bgscan' '0' option 'diversity' '1' + #enable correct wifi led https://forum.openwrt.org/viewtopic.php?id=29714 + option 'softled' '0' config 'wifi-iface' option 'device' 'wifi0' diff --git a/root_file_system/dir300/etc/sysctl.conf b/root_file_system/dir300/etc/sysctl.conf index fe9e29a..022e78a 100644 --- a/root_file_system/dir300/etc/sysctl.conf +++ b/root_file_system/dir300/etc/sysctl.conf @@ -23,7 +23,7 @@ net.bridge.bridge-nf-call-arptables=0 net.bridge.bridge-nf-call-ip6tables=0 net.bridge.bridge-nf-call-iptables=0 -#Enable the correct wifi led on dir300 (only apply this to dir300!) +#Enable the correct wifi led on dir300 (only apply this to dir300!) https://forum.openwrt.org/viewtopic.php?id=29714 dev.wifi0.ledpin=2 dev.wifi0.softled=1 diff --git a/root_file_system/wrt54g_adhoc/etc/rc.local b/root_file_system/wrt54g_adhoc/etc/rc.local index 2ca896c..11dc58e 100755 --- a/root_file_system/wrt54g_adhoc/etc/rc.local +++ b/root_file_system/wrt54g_adhoc/etc/rc.local @@ -2,9 +2,14 @@ # the system init finished. By default this file does nothing. #set fixed mac address on br-mesh so that the ipv6 addres does not change after every reboot -HARDWARE_MACADDR=`ifconfig -a br-mesh | grep 'HWaddr' | awk '{ print $5}'` -uci set network.mesh.macaddr=$HARDWARE_MACADDR -uci commit +HARDWARE_MACADDR_ETH0=`ifconfig -a eth0 | grep 'HWaddr' | awk '{ print $5}'` +HARDWARE_MACADDR_MESH=`ifconfig -a br-mesh | grep 'HWaddr' | awk '{ print $5}'` + +if [[ "$HARDWARE_MACADDR_ETH0" != "$HARDWARE_MACADDR_MESH" ]]; then + uci set network.mesh.macaddr=$HARDWARE_MACADDR_ETH0 + uci commit + reboot +fi ifconfig br-mesh down ifconfig br-mesh up