don't trap Internet/DNS check error (#1098)

This commit is contained in:
tteckster 2023-02-24 01:00:53 -05:00 committed by GitHub
parent e840f2f26f
commit 271f29bc59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 162 additions and 0 deletions

View file

@ -63,6 +63,7 @@ msg_ok "Set up Container OS"
msg_ok "Network Connected: ${BL}$(hostname -I)"
set +e
trap - ERR
if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
msg_error "Internet NOT Connected"
read -r -p "Would you like to continue anyway? <y/N> " prompt
@ -76,6 +77,7 @@ fi
RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
set -e
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
msg_info "Updating Container OS"
$STD apt-get update