Skip to content

Instantly share code, notes, and snippets.

@felipekm
Created August 21, 2018 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipekm/2f75ce385e9acf1ec7dd66622b7352fa to your computer and use it in GitHub Desktop.
Save felipekm/2f75ce385e9acf1ec7dd66622b7352fa to your computer and use it in GitHub Desktop.
Validates if a PM2 process is running
#!/bin/bash
sudo pm2 describe login > /dev/null
RUNNING=$?
if [ "${RUNNING}" -ne 0 ]; then
echo "not running"
else
echo "is running"
fi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment