Update install.func

This commit is contained in:
CanbiZ 2025-06-30 13:12:35 +02:00
parent d60f0ebd72
commit 2637a70057

View File

@ -65,7 +65,8 @@ setting_up_container() {
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
systemctl disable -q --now systemd-networkd-wait-online.service systemctl disable -q --now systemd-networkd-wait-online.service
msg_ok "Set up Container OS" msg_ok "Set up Container OS"
msg_custom "${CM}" "${GN}" "Network Connected: ${BL}$(hostname -I)" #msg_custom "${CM}" "${GN}" "Network Connected: ${BL}$(hostname -I)"
msg_ok "Network Connected: ${BL}$(hostname -I)"
} }
# This function checks the network connection by pinging a known IP address and prompts the user to continue if the internet is not connected # This function checks the network connection by pinging a known IP address and prompts the user to continue if the internet is not connected
@ -104,24 +105,24 @@ network_check() {
fi fi
# 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" "git.community-scripts.org") GIT_HOSTS=("github.com" "raw.githubusercontent.com" "api.github.com" "git.community-scripts.org")
GITHUB_STATUS="GitHub DNS:" GIT_STATUS="Git DNS:"
DNS_FAILED=false DNS_FAILED=false
for HOST in "${GITHUB_HOSTS[@]}"; do for HOST in "${GIT_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=$(getent hosts "$HOST" | awk '{ print $1 }' | grep -E '(^([0-9]{1,3}\.){3}[0-9]{1,3}$)|(^[a-fA-F0-9:]+$)' | head -n1)
if [[ -z "$RESOLVEDIP" ]]; then if [[ -z "$RESOLVEDIP" ]]; then
GITHUB_STATUS+="$HOST:($DNSFAIL)" GIT_STATUS+="$HOST:($DNSFAIL)"
DNS_FAILED=true DNS_FAILED=true
else else
GITHUB_STATUS+=" $HOST:($DNSOK)" GIT_STATUS+=" $HOST:($DNSOK)"
fi fi
done done
if [[ "$DNS_FAILED" == true ]]; then if [[ "$DNS_FAILED" == true ]]; then
fatal "$GITHUB_STATUS" fatal "$GIT_STATUS"
else else
msg_ok "$GITHUB_STATUS" msg_ok "$GIT_STATUS"
fi fi
set -e set -e