I don't see any difference to the already existing gargoyle_button_handler:
Code: Select all
cat gargoyle_button_handler
#!/bin/sh
. /lib/functions.sh
do_button () {
local button
local action
local handler
local min
local max
config_get button $1 button
config_get action $1 action
config_get handler $1 handler
config_get min $1 min
config_get max $1 max
[ "$ACTION" = "$action" -a "$BUTTON" = "$button" -a -n "$handler" ] && {
[ -z "$min" -o -z "$max" ] && eval $handler
[ -n "$min" -a -n "$max" ] && {
[ $min -le $SEEN -a $max -ge $SEEN ] && eval $handler
}
}
}
config_load system
config_foreach do_button button
Code: Select all
ls -l
lrwxrwxrwx 1 root root 23 Jul 7 23:55 failsafe -> gargoyle_button_handler
-rwxr-xr-x 1 root root 523 Jul 7 22:40 gargoyle_button_handler
lrwxrwxrwx 1 root root 23 Jul 7 23:55 power -> gargoyle_button_handler
lrwxrwxrwx 1 root root 23 Jul 7 23:55 reset -> gargoyle_button_handler
lrwxrwxrwx 1 root root 23 Jul 7 23:55 rfkill -> gargoyle_button_handler
lrwxrwxrwx 1 root root 23 Jul 7 23:55 wps -> gargoyle_button_handler
Code: Select all
logread -f
Nothing returned
Code: Select all
logread |grep user
Tue Sep 6 20:00:44 2016 user.notice root: vsftpd init: mounted = 0
Tue Sep 6 20:00:44 2016 user.emerg syslog: ERROR: No drives attached, no directories to share!
Tue Sep 6 20:00:44 2016 user.emerg syslog: setting up led USB1
Tue Sep 6 20:00:44 2016 user.emerg syslog: setting up led USB2
Tue Sep 6 20:00:44 2016 user.emerg syslog: setting up led WLAN2G
Tue Sep 6 20:00:44 2016 user.emerg syslog: setting up led WLAN5G
Wed Sep 7 08:40:31 2016 user.notice firewall: Reloading firewall due to ifup of wan6 (eth0)
Wed Sep 7 08:40:43 2016 user.notice firewall: Reloading firewall due to ifup of wan (pppoe-wan)