Moved online connection check
This commit is contained in:
parent
d49fc2a79c
commit
597e3006d8
14
run.sh
14
run.sh
@ -1,5 +1,12 @@
|
||||
#! /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
|
||||
|
||||
echo "*******************"
|
||||
@ -160,13 +167,6 @@ sleep 0.1
|
||||
gpio -1 write 22 0
|
||||
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.
|
||||
|
||||
while true
|
||||
|
Loading…
Reference in New Issue
Block a user