1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-03-08 13:19:05 +00:00

Update create_lxc.sh

This commit is contained in:
CanbiZ 2025-02-24 14:23:05 +01:00 committed by GitHub
parent de4f7c3166
commit 03a2c41718
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -178,18 +178,18 @@ function select_storage() {
}
# Check for network connectivity (IPv4 & IPv6)
function check_network() {
local CHECK_URLS=("8.8.8.8" "1.1.1.1" "9.9.9.9" "2606:4700:4700::1111" "2001:4860:4860::8888" "2620:fe::fe")
for url in "${CHECK_URLS[@]}"; do
if ping -c 1 -W 2 "$url" &>/dev/null; then
return 0 # Success: At least one connection works
fi
done
msg_error "No network connection detected. Check your internet connection."
exit 101
}
#function check_network() {
# local CHECK_URLS=("8.8.8.8" "1.1.1.1" "9.9.9.9" "2606:4700:4700::1111" "2001:4860:4860::8888" "2620:fe::fe")
#
# for url in "${CHECK_URLS[@]}"; do
# if ping -c 1 -W 2 "$url" &>/dev/null; then
# return 0 # Success: At least one connection works
# fi
# done
#
# msg_error "No network connection detected. Check your internet connection."
# exit 101
#}
# Test if ID is in use
if qm status "$CTID" &>/dev/null || pct status "$CTID" &>/dev/null; then
@ -209,7 +209,7 @@ msg_ok "Using ${BL}$CONTAINER_STORAGE${CL} ${GN}for Container Storage."
# Update LXC template list
msg_info "Updating LXC Template List"
check_network
#check_network
pveam update >/dev/null
msg_ok "Updated LXC Template List"