From 26bbfdee8b159eafb2736d860c5cde4d07180713 Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 5 May 2022 05:52:51 -0400 Subject: [PATCH] Update debian-install.sh --- setup/debian-install.sh | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/setup/debian-install.sh b/setup/debian-install.sh index 9c9476f8..a4cd2825 100644 --- a/setup/debian-install.sh +++ b/setup/debian-install.sh @@ -28,37 +28,6 @@ function error_exit() { exit $EXIT } -function internet() { - test_urls="\ - https://www.google.com/ \ - https://www.microsoft.com/ \ - https://www.cloudflare.com/ \ - " - processes="0" - pids="" - for test_url in $test_urls; do - curl --silent --head "$test_url" > /dev/null & - pids="$pids $!" - processes=$(($processes + 1)) - done - while [ $processes -gt 0 ]; do - for pid in $pids; do - if ! ps | grep "^[[:blank:]]*$pid[[:blank:]]" > /dev/null; then - processes=$(($processes - 1)) - pids=$(echo "$pids" | sed --regexp-extended "s/(^| )$pid($| )/ /g") - - if wait $pid; then - kill -TERM $pids > /dev/null 2>&1 || true - wait $pids - return 0 - fi - fi - done - sleep 0.1 - done - return 1 -} - function msg_info() { local msg="$1" echo -ne " ${HOLD} ${YW}${msg}..." @@ -85,10 +54,10 @@ done msg_ok "Set up Container OS" msg_ok "Network Connected: ${BL}$(hostname -I)" -if internet; then +if : >/dev/tcp/8.8.8.8/53; then msg_ok "Internet Online" else - echo -e "${BFR} {CROSS}${RD} Internet Offline" + echo -e "${BFR} ${CROSS}${RD} Internet Offline" fi msg_info "Updating Container OS"