Script for scheduled check of websites availability and reboot the machine. Suited for crontab job. The idea is to help my machine to re-establish network and vpn connections.
-
Create
emails.lst
file and fill it with each email in new line (as inemails.lst.example
). leave an empty line in the end. -
Create
websites.lst
file and fill it with each website in a new line (as inwebsites.lst.example
). leave an empty line in the end.Note that the script will follow url(s) with 301 (redirect). Config 1 is no longer a feature i need. So i comment it out, if you need it, uncomment the section where it deals with the email
Add the following lines to crontab config ($ crontab -e)
THIS_IS_CRON=1
SHELL=/bin/bash
*/30 * * * * /path/to/isOnline/checker.sh
in this example crontab will run checker.sh
every 30min and will force to use bash instead of sh, seems to not work under sh in ubbuntu