HI all,
I am trying to have a script enable/disable dhcp on the lan interface based on the switch position of my AR300M. This should be pretty straightforward but for some reason it seems that the script never gets executed when I change the switch position. Here is the code I have in /etc/rc.button/BTN_8:
#!/bin/sh
#This is the switch of AR150, left pressed, release right
logger "Button: $BUTTON ; State: ${ACTION}";
if [ "${ACTION}" == "pressed" ]; then
logger "Disable DHCP on LAN";
uci set dhcp.lan.ignore=1;
uci commit dhcp;
/etc/init.d/dnsmasq restart;
/etc/init.d/network reload;
else
logger "Enable DHCP on LAN";
uci set dhcp.lan.ignore=0;
uci commit dhcp;
/etc/init.d/dnsmasq restart;
/etc/init.d/network reload;
fi
Anything I may have missed?