About button handler
Posted: Sun Nov 28, 2010 4:05 am
Now in ar71xx target we have button handler. I suggest add in /etc/config/system something like:
After push button BTN_0 (reset):
5-10s - reboot
30-120 - restore deafults
I also use
to toggle wifi (BTN_1 = qss in tplink 1043, wps in wrt160nl)
/sbin/wifionoff:
Edit: or configure via gui action and time associated with button. Better solution.
Code: Select all
config 'button'
option button BTN_0
option action released
option handler 'reboot'
option min 5
option max 10
config 'button'
option button BTN_0
option action released
option handler 'firstboot && reboot'
option min 30
option max 120
5-10s - reboot
30-120 - restore deafults
I also use
Code: Select all
config 'button'
option button BTN_1
option action released
option handler '/sbin/wifionoff'
option min 0
option max 2
/sbin/wifionoff:
Code: Select all
#!/bin/sh
SW=$(uci -q get wireless.@wifi-device[0].disabled)
[ "$SW" == "1" ] && uci set wireless.@wifi-device[0].disabled=0
[ "$SW" == "1" ] || uci set wireless.@wifi-device[0].disabled=1
wifi