Skip to content

Instantly share code, notes, and snippets.

@sgsheg
Created August 23, 2014 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgsheg/c4b318c2fc726b44753c to your computer and use it in GitHub Desktop.
Save sgsheg/c4b318c2fc726b44753c to your computer and use it in GitHub Desktop.
listen php-fpm stop

Listen php-fpm stop and restart it again


#!/bin/bash
# author: Teddy

CheckURL="http://fueux.com"

STATUS_CODE=`curl -o /dev/null -m 10 --connect-timeout 10 -s -w %{http_code} $CheckURL`
#echo "$CheckURL Status Code:\t$STATUS_CODE"
if [ "$STATUS_CODE" = "502" ]; then
        /etc/init.d/php-fpm restart
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment