Files @ a037ca46ced9
Branch filter:

Location: freifunk/torian/ffluxbot/ff_reachable_check_lists.sh - annotation

Fantawams
initial scripts off the ffluxbot
#!/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 </home/scripts/ffluxbot/iplist.txt