mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-09-14 10:47:36 +00:00
Merge pull request #302 from Vaso73/fix/pve-update-failure-status
fix: report Proxmox update failures correctly
This commit is contained in:
@@ -104,26 +104,26 @@ update_pve_safe() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Reachability check: HEAD https://download.proxmox.com over the same
|
# Reachability check: probe the public Proxmox repository over the
|
||||||
# transport apt-get update will use (HTTPS 443). Previously a single
|
# transport apt is most likely to use. Many PVE installs use the
|
||||||
# ICMP ping — hosts behind firewalls that filter ICMP but allow 443
|
# official HTTP apt URI, while HTTPS may fail before apt ever runs
|
||||||
# (typical corporate / cloud-provider setups) hit a false negative
|
# if the CDN presents a certificate for another Proxmox hostname.
|
||||||
# and the update aborted even though the repository was reachable.
|
# Accept either transport and let apt-get update report repo-specific
|
||||||
# Two attempts with a short pause absorb transient network glitches
|
# errors in the next step.
|
||||||
# without adding perceptible latency when the network is healthy.
|
|
||||||
_repo_reachable() {
|
_repo_reachable() {
|
||||||
local url="https://download.proxmox.com/"
|
local url attempt
|
||||||
local attempt
|
for url in "http://download.proxmox.com/" "https://download.proxmox.com/"; do
|
||||||
for attempt in 1 2; do
|
for attempt in 1 2; do
|
||||||
if curl -sfI --connect-timeout 5 --max-time 10 -o /dev/null "$url"; then
|
if curl -sfI --connect-timeout 5 --max-time 10 -o /dev/null "$url"; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
[[ $attempt -eq 1 ]] && sleep 1
|
[[ $attempt -eq 1 ]] && sleep 1
|
||||||
|
done
|
||||||
done
|
done
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
if ! _repo_reachable; then
|
if ! _repo_reachable; then
|
||||||
msg_error "$(translate "Cannot reach https://download.proxmox.com (HTTPS 443). Check network, proxy or DNS.")"
|
msg_error "$(translate "Cannot reach download.proxmox.com. Check network, proxy or DNS.")"
|
||||||
echo -e
|
echo -e
|
||||||
msg_success "$(translate "Press Enter to return to menu...")"
|
msg_success "$(translate "Press Enter to return to menu...")"
|
||||||
read -r
|
read -r
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ apt_upgrade() {
|
|||||||
# Single worker for both PVE 8 and 9 — it detects the version itself
|
# Single worker for both PVE 8 and 9 — it detects the version itself
|
||||||
# and only performs operations safe on a production host.
|
# and only performs operations safe on a production host.
|
||||||
bash "$LOCAL_SCRIPTS/global/update-pve-safe.sh"
|
bash "$LOCAL_SCRIPTS/global/update-pve-safe.sh"
|
||||||
|
local worker_rc=$?
|
||||||
|
return "$worker_rc"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -162,11 +164,14 @@ check_reboot() {
|
|||||||
|
|
||||||
|
|
||||||
apt_upgrade
|
apt_upgrade
|
||||||
check_reboot
|
update_rc=$?
|
||||||
|
if [[ "$update_rc" -eq 0 ]]; then
|
||||||
|
check_reboot
|
||||||
|
else
|
||||||
|
exit "$update_rc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user