Created
October 8, 2014 13:28
-
-
Save vinzdef/606405fee3475a98f598 to your computer and use it in GitHub Desktop.
Check if process is running
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
#check if a process named X is running | |
if [ -z "$(pidof X )" ] #CHANGE X WITH PROCESS NAME | |
then | |
# process was found | |
else | |
# process not found | |
fi | |
#ALSO | |
#check if process CONTAINING X is running | |
if [ -z "$(pgrep X )" ] #CHANGE X WITH PROCESS NAME | |
then | |
# process was found | |
else | |
# process not found | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment