Update upgrade_pve8_to_pve9.sh

This commit is contained in:
MacRimi 2025-08-14 20:03:47 +02:00
parent 9a27138d96
commit 0654a3ed55

View File

@ -48,6 +48,15 @@ done
# ========================================================== # ==========================================================
run_manual_guide() {
local url="$REPO_URL/scripts/utilities/proxmox-upgrade-pve8-to-pve9-manual-guide.sh"
if command -v curl >/dev/null 2>&1; then
bash <(curl -fsSL "$url")
else
bash <(wget -qO- "$url")
fi
}
ask_run_mode() { ask_run_mode() {
if [[ "${ASSUME_YES:-0}" == "1" ]]; then if [[ "${ASSUME_YES:-0}" == "1" ]]; then
@ -57,8 +66,10 @@ ask_run_mode() {
return 0 return 0
fi fi
while true; do
if command -v dialog >/dev/null 2>&1; then if command -v dialog >/dev/null 2>&1; then
local title text choice local title text choice status
title="$(translate "Select run mode")"; [[ -z "$title" ]] && title="Select run mode" title="$(translate "Select run mode")"; [[ -z "$title" ]] && title="Select run mode"
text="$(translate "Choose how to perform the upgrade:")"; [[ -z "$text" ]] && text="Choose how to perform the upgrade:" text="$(translate "Choose how to perform the upgrade:")"; [[ -z "$text" ]] && text="Choose how to perform the upgrade:"
title=${title//$'\r'/}; title=${title//$'\n'/' '} title=${title//$'\r'/}; title=${title//$'\n'/' '}
@ -74,6 +85,7 @@ ask_run_mode() {
3>&1 1>&2 2>&3 3>&1 1>&2 2>&3
); status=$? ); status=$?
if [[ $status -ne 0 ]]; then if [[ $status -ne 0 ]]; then
show_proxmenux_logo || true show_proxmenux_logo || true
msg_warn "$(translate "Action canceled by user")" msg_warn "$(translate "Action canceled by user")"
@ -88,19 +100,17 @@ ask_run_mode() {
msg_info2 "$(translate "Run mode selected: Unattended")" msg_info2 "$(translate "Run mode selected: Unattended")"
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none export APT_LISTCHANGES_FRONTEND=none
break
;; ;;
3) 3)
local url="$REPO_URL/scripts/utilities/proxmox-upgrade-pve8-to-pve9-manual-guide.sh" run_manual_guide
if command -v curl >/dev/null 2>&1; then continue
bash <(curl -fsSL "$url")
else
bash <(wget -qO- "$url")
fi
;; ;;
*) *)
show_proxmenux_logo || true show_proxmenux_logo || true
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")" msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
msg_info2 "$(translate "Run mode selected: Interactive")" msg_info2 "$(translate "Run mode selected: Interactive")"
break
;; ;;
esac esac
@ -118,39 +128,61 @@ ask_run_mode() {
msg_warn "$(translate "Action canceled by user")" msg_warn "$(translate "Action canceled by user")"
exit 0 exit 0
fi fi
case "$choice" in case "$choice" in
1) ASSUME_YES="1"; msg_info2 "$(translate "Run mode selected: Unattended")" 1)
ASSUME_YES="1"
show_proxmenux_logo || true
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
msg_info2 "$(translate "Run mode selected: Unattended")"
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none ;; export APT_LISTCHANGES_FRONTEND=none
3) local url="$REPO_URL/scripts/utilities/proxmox-upgrade-pve8-to-pve9-manual-guide.sh" break
if command -v curl >/dev/null 2>&1; then ;;
bash <(curl -fsSL "$url") 3)
else run_manual_guide
bash <(wget -qO- "$url") continue
fi ;; ;;
*) msg_info2 "$(translate "Run mode selected: Interactive")" ;; *)
show_proxmenux_logo || true
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
msg_info2 "$(translate "Run mode selected: Interactive")"
break
;;
esac esac
else else
printf "%s" "$(translate "Select run mode: [1]unattended / [2]interactive / [3]manual guide? (default: 2): ")" printf "%s" "$(translate "Select run mode: [1]unattended / [2]interactive / [3]manual guide? (default: 2): ")"
read -r ans read -r ans
case "$ans" in case "$ans" in
1) ASSUME_YES="1"; msg_info2 "$(translate "Run mode selected: Unattended")" 1)
ASSUME_YES="1"
show_proxmenux_logo || true
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
msg_info2 "$(translate "Run mode selected: Unattended")"
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none ;; export APT_LISTCHANGES_FRONTEND=none
3) local url="$REPO_URL/scripts/utilities/proxmox-upgrade-pve8-to-pve9-manual-guide.sh" break
if command -v curl >/dev/null 2>&1; then ;;
bash <(curl -fsSL "$url") || exit 1 3)
else run_manual_guide
bash <(wget -qO- "$url") || exit 1 continue
fi ;; ;;
*) msg_info2 "$(translate "Run mode selected: Interactive")" ;; *)
show_proxmenux_logo || true
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
msg_info2 "$(translate "Run mode selected: Interactive")"
break
;;
esac esac
fi fi
done
} }
# ========================================================== # ==========================================================