ansible.fftdf.supernode/files/keepalive.exit.sh.j2

30 lines
555 B
Plaintext
Raw Permalink Normal View History

#!/bin/sh
#
# -q quiet
# -c nb of pings
2016-01-26 23:15:32 +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
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
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