mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-08-15 09:22:23 +00:00
Update upgrade_pve8_to_pve9.sh
This commit is contained in:
parent
9a27138d96
commit
0654a3ed55
@ -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,100 +66,123 @@ ask_run_mode() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v dialog >/dev/null 2>&1; then
|
|
||||||
local title text choice
|
|
||||||
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:"
|
|
||||||
title=${title//$'\r'/}; title=${title//$'\n'/' '}
|
|
||||||
text=${text//$'\r'/}; text=${text//$'\n'/' '}
|
|
||||||
|
|
||||||
choice=$(
|
while true; do
|
||||||
dialog --backtitle "ProxMenux" \
|
if command -v dialog >/dev/null 2>&1; then
|
||||||
--title "$title" \
|
local title text choice status
|
||||||
--menu "$text" 17 78 3 \
|
title="$(translate "Select run mode")"; [[ -z "$title" ]] && title="Select run mode"
|
||||||
1 "$(translate "Automatic/Unattended")" \
|
text="$(translate "Choose how to perform the upgrade:")"; [[ -z "$text" ]] && text="Choose how to perform the upgrade:"
|
||||||
2 "$(translate "Interactive (guided, prompts visible)")" \
|
title=${title//$'\r'/}; title=${title//$'\n'/' '}
|
||||||
3 "$(translate "Manual upgrade guide step by step")" \
|
text=${text//$'\r'/}; text=${text//$'\n'/' '}
|
||||||
3>&1 1>&2 2>&3
|
|
||||||
); status=$?
|
|
||||||
|
|
||||||
if [[ $status -ne 0 ]]; then
|
choice=$(
|
||||||
show_proxmenux_logo || true
|
dialog --backtitle "ProxMenux" \
|
||||||
msg_warn "$(translate "Action canceled by user")"
|
--title "$title" \
|
||||||
exit 0
|
--menu "$text" 17 78 3 \
|
||||||
fi
|
1 "$(translate "Automatic/Unattended")" \
|
||||||
|
2 "$(translate "Interactive (guided, prompts visible)")" \
|
||||||
|
3 "$(translate "Manual upgrade guide step by step")" \
|
||||||
|
3>&1 1>&2 2>&3
|
||||||
|
); status=$?
|
||||||
|
|
||||||
case "$choice" in
|
|
||||||
1)
|
if [[ $status -ne 0 ]]; then
|
||||||
ASSUME_YES="1"
|
|
||||||
show_proxmenux_logo || true
|
show_proxmenux_logo || true
|
||||||
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
|
msg_warn "$(translate "Action canceled by user")"
|
||||||
msg_info2 "$(translate "Run mode selected: Unattended")"
|
exit 0
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
fi
|
||||||
export APT_LISTCHANGES_FRONTEND=none
|
|
||||||
;;
|
case "$choice" in
|
||||||
3)
|
1)
|
||||||
local url="$REPO_URL/scripts/utilities/proxmox-upgrade-pve8-to-pve9-manual-guide.sh"
|
ASSUME_YES="1"
|
||||||
if command -v curl >/dev/null 2>&1; then
|
show_proxmenux_logo || true
|
||||||
bash <(curl -fsSL "$url")
|
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
|
||||||
else
|
msg_info2 "$(translate "Run mode selected: Unattended")"
|
||||||
bash <(wget -qO- "$url")
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
fi
|
export APT_LISTCHANGES_FRONTEND=none
|
||||||
;;
|
break
|
||||||
*)
|
;;
|
||||||
|
3)
|
||||||
|
run_manual_guide
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
show_proxmenux_logo || true
|
||||||
|
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
|
||||||
|
msg_info2 "$(translate "Run mode selected: Interactive")"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
elif command -v whiptail >/dev/null 2>&1; then
|
||||||
|
local choice
|
||||||
|
if ! choice=$(
|
||||||
|
whiptail --title "$(translate "Select run mode")" \
|
||||||
|
--menu "$(translate "Choose how to perform the upgrade:")" 17 78 3 \
|
||||||
|
"1" "$(translate "Automatic/Unattended")" \
|
||||||
|
"2" "$(translate "Interactive (guided, prompts visible)")" \
|
||||||
|
"3" "$(translate "Manual upgrade guide step by step")" \
|
||||||
|
3>&1 1>&2 2>&3
|
||||||
|
); then
|
||||||
show_proxmenux_logo || true
|
show_proxmenux_logo || true
|
||||||
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
|
msg_warn "$(translate "Action canceled by user")"
|
||||||
msg_info2 "$(translate "Run mode selected: Interactive")"
|
exit 0
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
|
|
||||||
elif command -v whiptail >/dev/null 2>&1; then
|
case "$choice" in
|
||||||
local choice
|
1)
|
||||||
if ! choice=$(
|
ASSUME_YES="1"
|
||||||
whiptail --title "$(translate "Select run mode")" \
|
show_proxmenux_logo || true
|
||||||
--menu "$(translate "Choose how to perform the upgrade:")" 17 78 3 \
|
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
|
||||||
"1" "$(translate "Automatic/Unattended")" \
|
msg_info2 "$(translate "Run mode selected: Unattended")"
|
||||||
"2" "$(translate "Interactive (guided, prompts visible)")" \
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
"3" "$(translate "Manual upgrade guide step by step")" \
|
export APT_LISTCHANGES_FRONTEND=none
|
||||||
3>&1 1>&2 2>&3
|
break
|
||||||
); then
|
;;
|
||||||
show_proxmenux_logo || true
|
3)
|
||||||
msg_warn "$(translate "Action canceled by user")"
|
run_manual_guide
|
||||||
exit 0
|
continue
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
show_proxmenux_logo || true
|
||||||
|
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
|
||||||
|
msg_info2 "$(translate "Run mode selected: Interactive")"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
else
|
||||||
|
printf "%s" "$(translate "Select run mode: [1]unattended / [2]interactive / [3]manual guide? (default: 2): ")"
|
||||||
|
read -r ans
|
||||||
|
case "$ans" in
|
||||||
|
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 APT_LISTCHANGES_FRONTEND=none
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
run_manual_guide
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
show_proxmenux_logo || true
|
||||||
|
msg_title "$(translate "Upgrade assistant: Proxmox VE 8 → 9 (Trixie)")"
|
||||||
|
msg_info2 "$(translate "Run mode selected: Interactive")"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
case "$choice" in
|
done
|
||||||
1) ASSUME_YES="1"; msg_info2 "$(translate "Run mode selected: Unattended")"
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
|
||||||
export APT_LISTCHANGES_FRONTEND=none ;;
|
|
||||||
3) 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 ;;
|
|
||||||
*) msg_info2 "$(translate "Run mode selected: Interactive")" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
else
|
|
||||||
printf "%s" "$(translate "Select run mode: [1]unattended / [2]interactive / [3]manual guide? (default: 2): ")"
|
|
||||||
read -r ans
|
|
||||||
case "$ans" in
|
|
||||||
1) ASSUME_YES="1"; msg_info2 "$(translate "Run mode selected: Unattended")"
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
|
||||||
export APT_LISTCHANGES_FRONTEND=none ;;
|
|
||||||
3) 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") || exit 1
|
|
||||||
else
|
|
||||||
bash <(wget -qO- "$url") || exit 1
|
|
||||||
fi ;;
|
|
||||||
*) msg_info2 "$(translate "Run mode selected: Interactive")" ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ==========================================================
|
# ==========================================================
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user