I want to write a script that would start two daemon jobs in two different directories. This script should run in the foreground, and then when I press ctrl-c, the script would exit and bring down the two daemons with it.
Say the two daemons are two executables called daemon1
and daemon2
, and the two directories in which they need to start respectively are dir1
and dir2
.
How would I write such a script?