Initial Commit.

This commit is contained in:
2019-11-15 19:27:27 +00:00
parent 468ce973b5
commit a2b57b2426
18 changed files with 467 additions and 0 deletions
Executable
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
# run the given command, but only if it's not already running.
# singleton.sh long_running_script.sh --arguments --allowed
ALL="$@"
# if the exact script is not running currently, then start it
if [[ "`pgrep -f -x -c \"${ALL[@]}\"`" -eq "0" ]]; then
LOCATION=`dirname "$0"`
echo "[`date`] Restarting Script: $@" >> "$LOCATION/log/singleton.log"
$1 "${@:2}"
fi