Compare commits
No commits in common. "79533c055bb4164844e81646fe379a8103c005f2" and "626ecd2248bb5d41fe3407cc9aa2f0e4d13c5e9d" have entirely different histories.
79533c055b
...
626ecd2248
@ -123,18 +123,8 @@ network_check() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GITHUB_HOSTS=("github.com" "raw.githubusercontent.com" "api.github.com")
|
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
|
||||||
for HOST in "${GITHUB_HOSTS[@]}"; do
|
|
||||||
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}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user