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

View File

@ -126,25 +126,24 @@ network_check() {
# DNS resolution checks for GitHub-related domains (IPv4 and/or IPv6)
GITHUB_HOSTS=("github.com" "raw.githubusercontent.com" "api.github.com")
GITHUB_STATUS="GitHub DNS:"
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=""
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
GITHUB_STATUS+=" ❌ $HOST"
DNS_FAILED=true
msg_error "DNS resolution failed or no valid IPv4/IPv6 address for $HOST - Check your DNS or Adblocker settings"
exit 1
else
GITHUB_STATUS+=" ✅ $HOST"
msg_ok "Resolved $HOST → ${BL}$RESOLVEDIP${CL}"
fi
done
if [[ "$DNS_FAILED" == true ]]; then
msg_error "$GITHUB_STATUS"
exit 1
else
msg_ok "$GITHUB_STATUS"
fi
set -e
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
}