Have a few processes that we run with Forever that I have been working on automating.   Needed to be able to start them if they are not running and restart them if they are.  The restart was a bit tricky.  Usually you can just restart the process name, but since some of our processes have a wide variety of arguments that wasn’t always working.   So, first we try to find the processId using forever list and grep.   Then we can use that to determine if the process is running and what the process ID is if so.  Here is what I am currently using to do so: