From b0c2e96ea27f8ff4d23cac8ddae4429eee8b798a Mon Sep 17 00:00:00 2001 From: Dallas Winger Date: Thu, 29 Aug 2024 11:12:50 -0400 Subject: [PATCH] ensure DNS works, per dark_pyrro suggestion --- usr/bin/UPDATE_FIRMWARE | 5 +++++ usr/bin/UPDATE_PAYLOADS | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/usr/bin/UPDATE_FIRMWARE b/usr/bin/UPDATE_FIRMWARE index d5f8cb2..2f7de18 100755 --- a/usr/bin/UPDATE_FIRMWARE +++ b/usr/bin/UPDATE_FIRMWARE @@ -101,6 +101,11 @@ check_for_internet() { echo "You must have an internet connection to check for updates." exit 0 fi + + if ! ping -q -c 1 -W 1 google.com &>/dev/null 2>&1; then + echo "You must have an internet connection with working DNS to check for updates." + exit 0 + fi } check_for_upgrade() { diff --git a/usr/bin/UPDATE_PAYLOADS b/usr/bin/UPDATE_PAYLOADS index 3546282..fde5c89 100755 --- a/usr/bin/UPDATE_PAYLOADS +++ b/usr/bin/UPDATE_PAYLOADS @@ -7,6 +7,11 @@ check_for_internet() { echo "You must have an internet connection to sync the payload libraries." exit 0 fi + + if ! ping -q -c 1 -W 1 google.com &>/dev/null 2>&1; then + echo "You must have an internet connection with working DNS to check for updates." + exit 0 + fi } cleanup_tmp() {