====== TP-1043ND Qss button on/off wifi ======
I use below code in TP-WR1043ND and Gargoyle 1.5.10, it works.
/etc/config/system
config 'button' 'wifionoff'
option 'button' 'wps'
option 'action' 'released'
option 'handler' '/sbin/wifionoff'
option 'min' '0'
option 'max' '2'
config 'led' 'led_onoff'
option 'sysfs' 'tp-link:green:qss'
option 'trigger' 'timer'
option 'mode' 'link'
option 'default' '1'
option 'delayon' '2000'
option 'delayoff' '3000'
/sbin/wifionoff
#!/bin/sh
SW=`ifconfig wlan0 | wc -l`
if [ "$SW" == "7" ] ; then
echo 0 > /sys/class/leds/tp-link\:green\:qss/brightness
else
echo 1 > /sys/class/leds/tp-link\:green\:qss/brightness
echo timer > /sys/class/leds/tp-link\:green\:qss/trigger
echo 3000 > /sys/class/leds/tp-link\:green\:qss/delay_off
echo 2000 > /sys/class/leds/tp-link\:green\:qss/delay_on
fi
if [ "$SW" == "7" ] ; then wifi down; fi
if [ "$SW" == "0" ] ; then wifi up; fi
chmod + x /sbin/wifionoff
When wifi in on : qss led blink "slowly"