Greetings, I have an Atheros AP123 reference board with a switch for turning on/off the wireless and a reset button. I'd like to call a script when a button is pressed. I tried creating a test hotplug script (/tmp/hotplug) with the following contents:
Code:
#!/bin/sh
echo $* >> /tmp/hotplug.log
env >> /tmp/hotplug.log
and echo '/tmp/hotplug' > /proc/sys/kernel/hotplug
but when I press a button nothing gets logged. In dmesg however I can see "Reset button pressed." or "WIFI button pressed.". I found where these get echoed (arch/mips/atheros/gpio.c) but my knowledge for the linux kernel ends there. I can modify the source but I'm not sure if I add execve calls to the kernel is a good idea. Perhaps there's some way to make the kernel call hotplug with the button on press. Any help will be greatly appreciated. Thanks!