Created
March 25, 2019 16:06
-
-
Save 100daysofdevops/0702642db634d284df755ef04b6d501b 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" | |
| netstat -antulp|grep "$SERVICENAME" | |
| SERVICESTATUS=`echo $?` | |
| if [ "$SERVICESTATUS" != 0 ] | |
| then | |
| systemctl start $SERVICENAME | |
| echo "$SERVICENAME started" | |
| else | |
| echo "$SERVICENAME is already running" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment