Created
May 20, 2016 07:16
-
-
Save rishigb/a6935a556cba911624d37a1cf7940b9d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| status=`ps -efww | grep -w "[n]ode.sh" | awk -vpid=$$ '$2 != pid { print $2 }'` | |
| if [ ! -z "$status" ]; then | |
| echo "[`date`] : node.sh : Process is already running" | |
| exit 1; | |
| else | |
| echo "Restaring this shit" | |
| /home/ubuntu/code/fracktalBot/node.sh>log.log & | |
| exit 1; | |
| fi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Link that explains this: http://stackoverflow.com/questions/16807876/shell-script-execution-check-if-it-is-already-running-or-not