From a037ca46ced91eed6acfff40423ebe4ce2e05a18 2019-05-25 17:13:48 From: fantawams Date: 2019-05-25 17:13:48 Subject: [PATCH] initial scripts off the ffluxbot --- diff --git a/ffluxbot/ff_reachable_check_lists.sh b/ffluxbot/ff_reachable_check_lists.sh new file mode 100755 index 0000000000000000000000000000000000000000..8f87cd1e9186cc2534d6b1a33910539191c203b5 --- /dev/null +++ b/ffluxbot/ff_reachable_check_lists.sh @@ -0,0 +1,30 @@ +#!/bin/bash +timeout=2000 +pingcount=2 +interval=50 +while IFS= read -r ip; do + node_name=$(awk "/^$ip/ "'{print $NF}' /home/scripts/ffluxbot/FFnodes.txt) + + if fping6 -c $pingcount -t $timeout -i $interval "$ip" &>/dev/null; then + echo "$ip is Pingable" + else + echo "$ip Not Pingable" + echo "$node_name" + sleep 5 + if fping6 -c $pingcount -t $timeout -i $interval "$ip" &>/dev/null; then + echo "$ip is Pingable" + else + echo "$ip Not Pingable" + echo "$node_name" + sleep 5 + if fping6 -c $pingcount -t $timeout -i $interval "$ip" &>/dev/null; then + echo "$ip is Pingable" + else + echo "$ip Not Pingable" + echo "$node_name" + python3 /home/scripts/ffluxbot/send_client.py -d -j JIDofthebot -p passwordofthebot -t fantawams@c3l.lu -m "FreiFunk node $node_name with $ip is not reachable" + python3 /home/scripts/ffluxbot/send_client.py -d -j JIDofthebot -p passwordofthebot -t orimpe@c3l.lu -m "FreiFunk node $node_name with $ip is not reachable" + fi + fi +fi +done