Compare commits

..

No commits in common. "04d2af78a789fe838cd4411a5bd556340bbcda0d" and "362da467da4654fb0a08649689d97a8e93ed55d6" have entirely different histories.

View File

@ -96,7 +96,6 @@ network_check() {
ipv4_connected=false
ipv6_connected=false
sleep 1
# 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"
@ -124,20 +123,12 @@ network_check() {
fi
fi
# DNS resolution checks for GitHub-related domains (IPv4 and/or IPv6)
GITHUB_HOSTS=("github.com" "raw.githubusercontent.com" "api.github.com")
for HOST in "${GITHUB_HOSTS[@]}"; do
RESOLVEDIP=""
while read -r IP; do
if [[ "$IP" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ || "$IP" =~ ^[a-fA-F0-9:]+$ ]]; then
RESOLVEDIP="$IP"
break
fi
done < <(getent hosts "$HOST" | awk '{ print $1 }')
if [[ -z "$RESOLVEDIP" ]]; then
msg_error "DNS resolution failed or no valid IPv4/IPv6 address for $HOST"
RESOLVEDIP=$(getent hosts "$HOST" | awk '{ print $1 }')
if [[ -z "$RESOLVEDIP" || (! "$RESOLVEDIP" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ && ! "$RESOLVEDIP" =~ ^([a-fA-F0-9:]+)$) ]]; then
msg_error "DNS resolution failed or invalid IP for $HOST"
exit 1
else
msg_ok "Resolved $HOST → ${BL}$RESOLVEDIP${CL}"