🔁 Bash script to managed multiple foreverjs instances at once.
It starts multiple specified scripts at once with foreverjs.
src="app.js"
On Line 5 specifies the name of the script to execute in the directories mentioned below.
declare -a arr=(
"folder1"
"folder2"
"folder3"
"and so on..."
)
From Line 8 to Line 13 sets the name of the folders (in the current directory) in which the script (specified above) will get executed.
declare -a abs=(
"ExampleScript1 -c python /path/to/script.py"
"ExampleScript2 /path/to/script.js"
"and so on..."
)
From Line 16 to Line 20 specifies other script. Whether they are in a different directory, are not NodeJS or if they do not feature a script with the above specified name you can add them here. All paths are absolut!
The script features some arguments:
Argument | Explanation |
---|---|
-s or --stop |
Stops all scripts |
-r or --restart |
Stops and restarts all scripts |
That's all 😸