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

Lists in Python -

android - can not access to progress bar in an other activity -

java - Vaadin 7 Pass Data Between Views -