Compare commits

..

No commits in common. "89e5720cc2f614c554ac0e525606e56f474a62cc" and "e6acb092b31affe8e5f200b3d876434df4baef63" have entirely different histories.

2 changed files with 18 additions and 19 deletions

View File

@ -223,13 +223,12 @@ __curl_err_handler() {
[[ -n "$curl_msg" ]] && printf "%s\n" "$curl_msg" >&2 [[ -n "$curl_msg" ]] && printf "%s\n" "$curl_msg" >&2
exit 1 exit 1
} }
detect_os_type() {
detect_os() { if [[ -n "${var_os:-}" ]]; then
case "$var_os" in CORE_OS="$var_os"
alpine) CORE_OS="alpine" ;; else
debian | ubuntu) CORE_OS="debian" ;; CORE_OS="debian"
*) CORE_OS="unknown" ;; fi
esac
} }
### dev spinner ### ### dev spinner ###
@ -241,6 +240,7 @@ spinner_frames=('⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏')
# Ensure POSIX compatibility across Alpine and Debian/Ubuntu # Ensure POSIX compatibility across Alpine and Debian/Ubuntu
# === Spinner Start === # === Spinner Start ===
start_spinner() { start_spinner() {
detect_os_type
local msg="$1" local msg="$1"
local spin_i=0 local spin_i=0
local interval=0.1 local interval=0.1

View File

@ -126,24 +126,23 @@ network_check() {
# DNS resolution checks for GitHub-related domains (IPv4 and/or IPv6) # DNS resolution checks for GitHub-related domains (IPv4 and/or IPv6)
GITHUB_HOSTS=("github.com" "raw.githubusercontent.com" "api.github.com") GITHUB_HOSTS=("github.com" "raw.githubusercontent.com" "api.github.com")
GITHUB_STATUS="GitHub DNS:"
for HOST in "${GITHUB_HOSTS[@]}"; do for HOST in "${GITHUB_HOSTS[@]}"; do
RESOLVEDIP=$(getent hosts "$HOST" | awk '{ print $1 }' | grep -E '(^([0-9]{1,3}\.){3}[0-9]{1,3}$)|(^[a-fA-F0-9:]+$)' | head -n1) RESOLVEDIP=""
if [[ -z "$RESOLVEDIP" ]]; then while read -r IP; do
GITHUB_STATUS+=" ❌ $HOST" if [[ "$IP" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ || "$IP" =~ ^[a-fA-F0-9:]+$ ]]; then
DNS_FAILED=true RESOLVEDIP="$IP"
else break
GITHUB_STATUS+=" ✅ $HOST"
fi fi
done done < <(getent hosts "$HOST" | awk '{ print $1 }')
if [[ "$DNS_FAILED" == true ]]; then if [[ -z "$RESOLVEDIP" ]]; then
msg_error "$GITHUB_STATUS" msg_error "DNS resolution failed or no valid IPv4/IPv6 address for $HOST - Check your DNS or Adblocker settings"
exit 1 exit 1
else else
msg_ok "$GITHUB_STATUS" msg_ok "Resolved $HOST → ${BL}$RESOLVEDIP${CL}"
fi fi
done
set -e set -e
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR trap 'error_handler $LINENO "$BASH_COMMAND"' ERR