#!/bin/bash ABORT="3" if [ -z ${CHECK} ] then declare -x CHECK="0" fi if wget --no-check-certificate -q -o /root/sslcheckdownload https://www.ferventwear.com/ then /bin/rm -f /root/sslcheckdownload unset CHECK exit 0 else if [ ${CHECK} -gt ${ABORT} ] then printf "\n\nHTTPD SSL FAILED\n\nAllowable Tries To Start Exceeded!.. Aborting.. \ \n\nPlease Check ASAP!!!!\n\n\nThanks,\n${HOSTNAME}" |mail -s "ALERT: SSL FAILURE \ -- ${HOSTNAME}" support@eleven2.com exit 0 else printf "\n\n++++SSL FAILED++++\n\n" # we think SSL Failed killall -9 httpd # kill apache pkill -9 httpd # kill it again service httpd start # try to start apache in -DSSL sleep 10 # We have to sleep while apache starts or we start an endless loop and that would be bad CHECK=$((CHECK+1)) # Increment $CHECK export CHECK # Make sure its an env variable exec /root/sslcheck.sh # re-execute this script fi # end of the if then statement fi exit 0 # we wont ever get here but eh we want to stay technicaly correct right?