Skip to content

Instantly share code, notes, and snippets.

@amiad
Created April 1, 2015 11:35
Show Gist options
  • Save amiad/47fa26af141925a92842 to your computer and use it in GitHub Desktop.
Save amiad/47fa26af141925a92842 to your computer and use it in GitHub Desktop.
check services in my server
#!/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