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

Popular posts from this blog

Combining PHP Registration and Login into one class with multiple functions in one PHP file -

Android volley - avoid multiple requests of the same kind to the server? -

magento2 - Magento 2 admin grid add filter to collection -