I'm trying to write a wrapper script in bash to automate startup and shutdown of three programs I need to run simultaneously:
#!/bin/bash
gnome-screensaver-command -i -n aeolus-wrapper.sh &
aeolus &
qjackctl
After starting them, I need to monitor aeolus and qjackctl and kill the remaining two processes if either aeolus or qjackctl exits:
# if aeolus exits, kill gnome-screensaver-command and qjackctl
# if qjackctl exits, kill gnome-screensaver-command and aeolus
This is where I'm stuck. I was intrigued by this example that shows how to use an until
loop to monitor a process and restart it if it dies, but I'm not quite sure how to get from there to where I want to go. Any suggestions very welcome.