#! /bin/bash
while true; do
ping -c 1 131.252.210.176
if [ $? -ne 0 ]; then
python /home/user1/Desktop/LEDj1on.py
echo "$(date)" >> /home/user1/ping_failures.log
else
python /home/user1/Desktop/LEDj1off.py
fi

if [ -s /home/user1/ping_failures.log ]; then
python /home/user1/Desktop/LEDr1on.py
else 
python /home/user1/Desktop/LEDr1off.py
fi

if [ -s /home/user1/ping_failures.log ]; then
python /home/user1/Desktop/LEDv1off.py
else 
python /home/user1/Desktop/LEDv1on.py
fi

sleep 1
done
