Skip to content

Instantly share code, notes, and snippets.

@ssebastianj
Last active December 11, 2015 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssebastianj/4655184 to your computer and use it in GitHub Desktop.
Save ssebastianj/4655184 to your computer and use it in GitHub Desktop.
Beginning with Ash (Busybox). This is a "Quick & Dirty" (yep, I'm "learning") script for blinking QSS LED when it reaches every "min" value on "/etc/config/system" file. Firmware: OpenWRT | Gargoyle. Hardware: TP-LINK WR1043ND (with little changes it can be ported to another routers).
config button 'blink_option'
option button 'wps'
option action 'pressed'
option handler '/sbin/blink_options.sh &'
option min '0'
option max '90'
config button 'stop_blinking'
option button 'wps'
option action 'released'
option handler '/sbin/stop_blinking.sh &'
option min '0'
option max '90'
#!/bin/sh
PID_FILE="/tmp/run/blinkoption.pid"
if [ -f $PID_FILE ]; then
PID=$(cat $PID_FILE)
echo $PID
kill $PID
rm -f $PID_FILE
fi
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment