summaryrefslogtreecommitdiff
path: root/files/sbin/test_gateway
blob: c6742a65ab8d15d7226fe3bd5faab94a55f65bc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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