Created
January 19, 2018 17:54
-
-
Save zarza/6407825471e4d24899cb0686b1e91bb2 to your computer and use it in GitHub Desktop.
If this found your service stopped it will try to start it
This file contains hidden or 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 | |
echo '[Start service if it is down]' | |
echo | |
# ZARZA | A HEAD OF OUR TIME | |
# https://zarza.com | |
service=nginx | |
if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 )) | |
then | |
echo "$service is up!" | |
else | |
/etc/init.d/$service start | |
fi | |
echo | |
echo '===========================================' | |
echo 'Brought to you thanks to https://zarza.com' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment