Created
June 2, 2020 11:21
-
-
Save ngtrieuvi92/4867c71ccd6d59c34ca8786dcf4d5354 to your computer and use it in GitHub Desktop.
[watch and reboot nginx] #nginx #autorestart
This file contains hidden or 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
STATUS="$(systemctl is-active nginx)" | |
if [ "${STATUS}" = "active" ]; then | |
echo "Execute your tasks ....." | |
curl --retry 3 https://hc-ping.com/<> | |
else | |
echo " Service not running.... so exiting " | |
systemctl start nginx | |
curl --retry 3 https://hc-ping.com/<> | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment