Moved online connection check

This commit is contained in:
Ray Ozzie 2016-03-28 19:48:33 -04:00
parent d49fc2a79c
commit 597e3006d8

14
run.sh
View File

@ -1,5 +1,12 @@
#! /bin/bash #! /bin/bash
# We need to be online, wait if needed.
while [[ $(ping -c1 google.com 2>&1 | grep " 0% packet loss") == "" ]]; do
echo "[TTN Gateway]: Waiting for internet connection..."
sleep 30
done
# Ensure that we've got the required env vars # Ensure that we've got the required env vars
echo "*******************" echo "*******************"
@ -160,13 +167,6 @@ sleep 0.1
gpio -1 write 22 0 gpio -1 write 22 0
sleep 0.1 sleep 0.1
# Test the connection, wait if needed.
while [[ $(ping -c1 google.com 2>&1 | grep " 0% packet loss") == "" ]]; do
echo "[TTN Gateway]: Waiting for internet connection..."
sleep 30
done
# Fire up the forwarder. # Fire up the forwarder.
while true while true