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? Quote 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 :) Quote Link to comment Share on other sites More sharing options...
PixL Posted May 26, 2018 Author Share Posted May 26, 2018 (edited) 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 Edited May 26, 2018 by PixL Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.