-
-
Save angelflo/dff15366bf2b979a9adb80c1718150ff to your computer and use it in GitHub Desktop.
Auto Restart PHP5-FPM When Down or Bad Gateway
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 | |
if curl --head -sf http://yourdomain.com/some-script.php -o /dev/null; then | |
echo "PHP FPM is up" | |
else | |
service php5-fpm restart && service nginx restart && service mysql restart | |
echo "Opps .. service was down" | mail -s "PHP-FPM Service Down" [email protected] -aFrom:[email protected] | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment