summaryrefslogtreecommitdiff
path: root/files/sbin/test_gateway
diff options
context:
space:
mode:
authorDarkeye <postfach@martinmichel.info>2011-01-22 22:13:06 (GMT)
committerDarkeye <postfach@martinmichel.info>2011-01-22 22:13:06 (GMT)
commitd992239563aa128ca389ed5014d9460ac968fb9e (patch)
tree39655a182f518b73b8199b0084d8fd589ab7029f /files/sbin/test_gateway
parent43fe4b9c171fbb1aaec1a6097ede48bf798d74de (diff)
Add test_gateway script as a cron. wan port is pinged every minute. If offline if-down-up -> retest if offline wan down
Diffstat (limited to 'files/sbin/test_gateway')
-rwxr-xr-xfiles/sbin/test_gateway17
1 files changed, 17 insertions, 0 deletions
diff --git a/files/sbin/test_gateway b/files/sbin/test_gateway
new file mode 100755
index 0000000..c6742a6
--- /dev/null
+++ b/files/sbin/test_gateway
@@ -0,0 +1,17 @@
+#!/bin/sh
+TESTHOST=4.2.2.4
+ping -c 1 -w 5 $TESTHOST &>/dev/null
+
+if [ $? -ne 0 ] ; then
+ // IP not reachable -> try if-down-up
+ ifdown wan
+ ifup wan
+ echo Problem we restart wan
+ sleep 10
+ // Test Again
+ ping -c 1 -w 5 4.2.2.4 &>/dev/null
+ if [ $? -ne 0 ] ; then
+ echo "Mist"
+ ifdown wan
+ fi
+fi
contact: Jan Huwald // Impressum