2016-01-27 16:33:47 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# -q quiet
|
|
|
|
# -c nb of pings
|
2016-01-26 23:15:32 +00:00
|
|
|
|
2016-01-27 16:33:47 +00:00
|
|
|
HOST1=8.8.8.8
|
|
|
|
HOST2=8.8.4.4
|
|
|
|
BATCTL=/usr/local/sbin/batctl
|
2016-01-26 23:15:32 +00:00
|
|
|
|
2016-01-27 16:33:47 +00:00
|
|
|
ping -q -c5 $HOST1 > /dev/null
|
|
|
|
if [ $? -eq 0 ]
|
|
|
|
then
|
|
|
|
echo "ok"
|
|
|
|
$BATCTL gw server 100Mbit/100Mbit
|
2016-01-26 23:15:32 +00:00
|
|
|
else
|
2016-01-27 16:33:47 +00:00
|
|
|
|
|
|
|
echo "$HOST1 NICHT ok"
|
|
|
|
ping -q -c5 $HOST2 > /dev/null
|
|
|
|
if [ $? -eq 0 ]
|
|
|
|
then
|
|
|
|
echo "$HOST2 ok"
|
|
|
|
$BATCTL gw server 100Mbit/100Mbit
|
|
|
|
else
|
|
|
|
echo "$HOST2 NICHT ok"
|
|
|
|
$BATCTL gw off
|
|
|
|
fi
|
|
|
|
|
2016-01-26 23:15:32 +00:00
|
|
|
fi
|
|
|
|
|