I have a bash menu that displays my 4 sprinkler zones. The commands are submitted to a background process.
I would like to add another menu option that kills any current background processes spawned by the script and turn off any GPIO pins. How can I do this?
This is my current code:
sprinklermenu.sh
-----------------
#!/bin/bash
MYITEMS="One Two quit"
select myitem in $MYITEMS
do
case $myitem in
One)
echo "Zone 1"
bash TestTimerInBackground.sh 1&
;;
Two)
echo "Zone 2"
;;
quit)
echo "Quit was selected"
break;
;;
esac
done