Created
April 16, 2019 15:50
-
-
Save 100daysofdevops/27b07f0e4233944522e5d6bd61f46729 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env bash | |
| servicename="httpd" | |
| if (( $(ps -ef | grep -v grep | grep $servicename | wc -l) > 0 )) | |
| then | |
| echo "$servicename is running!!!" | |
| else | |
| echo "$servicename is not running" | mail -s "$servicename is down" laprashant@gmail.com | |
| systemctl start $servicename | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment