Last active
December 18, 2015 16:39
-
-
Save zeevallin/5812761 to your computer and use it in GitHub Desktop.
This file contains 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
is_running() { | |
[ -f $1 ] || return 1 | |
read PID < $1 | |
[ -d /proc/${PID} ] || return 1 | |
return 0 | |
} | |
if is_running "/var/run/app.pid/"; then | |
echo "running" | |
else | |
echo "not running" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment