slitaz-forge rev 87

tank: Add chkwan. This is to check that the internet is up. If timestamp is more then 4 hours old then reboot.
author Christopher Rogers <slaxemulator@gmail.com>
date Fri Feb 17 12:36:46 2012 -0500 (2012-02-17)
parents f87008e748eb
children b2180a974f62
files tank/files/usr/bin/chkwan
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tank/files/usr/bin/chkwan	Fri Feb 17 12:36:46 2012 -0500
     1.3 @@ -0,0 +1,9 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +{
     1.7 +ping -c 2 8.8.8.8 > /dev/null || 
     1.8 +ping -c 2 8.8.4.4 > /dev/null || 
     1.9 +ping -c 2 94.23.60.116 > /dev/null || 
    1.10 +ping -c ssh.tuxfamily.org > /dev/null || 
    1.11 +} && touch /var/run/WAN
    1.12 +[ -n "$(find /var/run/WAN -mmin +240)" ] && reboot