Created
April 1, 2015 11:35
-
-
Save amiad/47fa26af141925a92842 to your computer and use it in GitHub Desktop.
check services in my server
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 | |
services="mysql nginx php5-fpm" | |
for service in $services; do | |
if [[ $(service $service status) != *"running"* ]]; then | |
service $service restart | |
[ $1 ] && echo "$service started" | |
fi | |
[ $1 ] && echo "$service scanned" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment