I want to use my buttons in owrt, so i edited to file /etc/hotplug2-init.rules:
...
SUBSYSTEM ~~ button {
exec kill -USR1 1 ;
}
to
...
SUBSYSTEM ~~ button {
exec /usr/bin/toggle.sh;
}
the file /usr/bin/toggle.sh contains this:
#!/bin/sh
tmpfile="/tmp/toggletmp"
if [ -f $tmpfile ] ; then
echo 1 > /proc/gpio/2_dir
echo 1 > /proc/gpio/2_out
rm $tmpfile
else
echo 1 > /proc/gpio/2_dir
echo 0 > /proc/gpio/2_out
echo 1 > $tmpfile
this means this script toggles only the wlan led on my atheros router. The problem is, while the button is pressed the script gets called all the time. I would prefer a message when the key is pressed and when the key is released. Is there a variable available i could use?
michu