diff --git a/misc/alpine-install.func b/misc/alpine-install.func index ce396f75c..ce2ed68de 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -86,10 +86,10 @@ network_check() { set +e trap - ERR if ping -c 1 -W 1 1.1.1.1 &>/dev/null || ping -c 1 -W 1 8.8.8.8 &>/dev/null || ping -c 1 -W 1 9.9.9.9 &>/dev/null; then - msg_ok "Internet Connected" + ipv4_status="${GN}✔${CL} IPv4" else - msg_error "Internet NOT Connected" - read -r -p "Would you like to continue anyway? " prompt + ipv4_status="${RD}✖${CL} IPv4" + read -r -p "Internet NOT connected. Continue anyway? " prompt if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then echo -e "${INFO}${RD}Expect Issues Without Internet${CL}" else @@ -98,7 +98,11 @@ network_check() { fi 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 + if [[ -z "$RESOLVEDIP" ]]; then + msg_error "Internet: ${ipv4_status} DNS Failed" + else + msg_ok "Internet: ${ipv4_status} DNS: ${BL}${RESOLVEDIP}${CL}" + fi set -e trap 'error_handler $LINENO "$BASH_COMMAND"' ERR } diff --git a/misc/error_handler.func b/misc/error_handler.func index fe207def6..5418a490e 100644 --- a/misc/error_handler.func +++ b/misc/error_handler.func @@ -235,7 +235,7 @@ error_handler() { if [[ -n "${CTID:-}" ]] && command -v pct &>/dev/null && pct status "$CTID" &>/dev/null; then echo "" echo -en "${YW}Remove broken container ${CTID}? (Y/n) [auto-remove in 60s]: ${CL}" - + if read -t 60 -r response; then if [[ -z "$response" || "$response" =~ ^[Yy]$ ]]; then echo -e "\n${YW}Removing container ${CTID}${CL}" diff --git a/misc/install.func b/misc/install.func index fd5284f41..0b3872ff5 100644 --- a/misc/install.func +++ b/misc/install.func @@ -122,20 +122,23 @@ network_check() { # Check IPv4 connectivity to Google, Cloudflare & Quad9 DNS servers. if ping -c 1 -W 1 1.1.1.1 &>/dev/null || ping -c 1 -W 1 8.8.8.8 &>/dev/null || ping -c 1 -W 1 9.9.9.9 &>/dev/null; then - msg_ok "IPv4 Internet Connected" ipv4_connected=true + ipv4_status="${GN}✔${CL} IPv4" else - msg_error "IPv4 Internet Not Connected" + ipv4_status="${RD}✖${CL} IPv4" fi # Check IPv6 connectivity to Google, Cloudflare & Quad9 DNS servers. if ping6 -c 1 -W 1 2606:4700:4700::1111 &>/dev/null || ping6 -c 1 -W 1 2001:4860:4860::8888 &>/dev/null || ping6 -c 1 -W 1 2620:fe::fe &>/dev/null; then - msg_ok "IPv6 Internet Connected" ipv6_connected=true + ipv6_status="${GN}✔${CL} IPv6" else - msg_error "IPv6 Internet Not Connected" + ipv6_status="${RD}✖${CL} IPv6" fi + # Show combined status + msg_ok "Internet: ${ipv4_status} ${ipv6_status}" + # If both IPv4 and IPv6 checks fail, prompt the user if [[ $ipv4_connected == false && $ipv6_connected == false ]]; then read -r -p "No Internet detected, would you like to continue anyway? " prompt