Files
han-gw/check_inet.sh

15 lines
251 B
Bash

#!/bin/bash
ping -c4 www.google.com
let a=$?
if [ "$a" != "0" ]; then
/sbin/shutdown -r +1 Connection lost, rebooting...
fi
# ToDo afterwards
# make executable
# chmod +x check_inet.sh
# add in crontab
# */30 * * * * /home/yourname/check_inet.sh