Skip to content

Instantly share code, notes, and snippets.

@rishigb
Created May 20, 2016 07:16
Show Gist options
  • Select an option

  • Save rishigb/a6935a556cba911624d37a1cf7940b9d to your computer and use it in GitHub Desktop.

Select an option

Save rishigb/a6935a556cba911624d37a1cf7940b9d to your computer and use it in GitHub Desktop.
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
@rishigb
Copy link
Copy Markdown
Author

rishigb commented May 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment