PixL Posted May 24, 2018 Share Posted May 24, 2018 I would like to create a script to start a command on pressing the button but then to stop the command when pressing the button again... any ideas? Link to comment Share on other sites More sharing options...
Sebkinne Posted May 25, 2018 Share Posted May 25, 2018 9 hours ago, PixL said: I would like to create a script to start a command on pressing the button but then to stop the command when pressing the button again... any ideas? Create a file in /tmp on the first press. If it exists, stop whatever you want, and remove the file. That should work :) Link to comment Share on other sites More sharing options...
PixL Posted May 26, 2018 Author Share Posted May 26, 2018 Like this? #!/bin/bash while [ ! -f /tmp/beacon ] do killall mdk3 led reset rm -rf /tmp/beacon else do touch /tmp/beacon mdk3 wlan1mon b -w -n Test led YELLOW on done Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.