Make sure an instance of the currently running script is only instanced once.
singlerun(killother, includeparams, mainProc)
Runs the mainProc if killother is true and is not currently running a script with the same name.
killotherboolean that specifies what to do if the script is already running, if true it will send a kill segterm to the other proc.
includeparamsboolean that tells singlerung to consider the arguments of the script as part of the search of a process already running, if false it will just consider the script name; i.e.
myscript.js --helpwould be different if includeparams is true.
singlerun =// run script and kill any other instance of same script witouth considering the parameters for uniqueness;// run script if not already running considering the parameters of the script;