blob: 97296e2a574be914a3928e66d62989b84e1863ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/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
sleep 10
// Test Again
ping -c 1 -w 5 4.2.2.4 &>/dev/null
if [ $? -ne 0 ] ; then
ifdown wan
fi
fi
|