Skip to content

Commit c2e0c27

Browse files
authored
Fix Internet Health Check (#2180)
* Revert "Fix Internet Health check" This reverts commit 5568da4. * Use ping and IP address for Internet check in healthCheck
1 parent caac7c0 commit c2e0c27

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

scripts/healthCheck

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,18 @@ HC_PingGateway() {
201201

202202
HC_Internet() {
203203
PrintItemHead "Internet Access"
204-
205-
curl http://50.116.60.82 --max-time 2 > /dev/null 2>&1 #this checks fppstats.falconchristmas.com
206-
rc=$?
207-
# If first check fails, then use backup.
208-
if [ $rc -ne 0 ]; then
209-
curl http://216.40.34.37 --max-time 2 > /dev/null 2>&1 #this checks kulp.com
210-
rc=$?
211-
fi
204+
# If one of these IP addresses are pingable then we have internet connectivity.
205+
ips=("1.1.1.1" "8.8.8.8" "9.9.9.9")
206+
# Initialize return code
207+
rc=1
208+
209+
# Loop through the IPs and try to ping
210+
for ip in "${ips[@]}"; do
211+
if ping -c 1 -q -W 2 "$ip" > /dev/null 2>&1; then
212+
rc=0
213+
break
214+
fi
215+
done
212216

213217
if [ $rc -eq 0 ]
214218
then

0 commit comments

Comments
 (0)