unix - Ubuntu: Script for check the status of a page and after restart -
how can programmatically check status of page in application? i'd able reboot server if receive 404
. possible on automated basis, checking page status @ 15 second intervals?
something like
#! /bin/bash while true; curl --fail --silent http://localhost/your.page >/dev/null if [[ $? -eq 22 ]]; sudo reboot fi sleep 15 done
check curl man page more details
Comments
Post a Comment