Created
November 23, 2015 22:35
-
-
Save micahblu/cc60696d77bdcab4be9f to your computer and use it in GitHub Desktop.
Checking for running service, start it if not
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
#!/bin/bash | |
service=replace_me_with_a_valid_service | |
if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 )) | |
then | |
echo "$service is running!!!" | |
else | |
/etc/init.d/$service start | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment