Update post-pve-install.sh

This commit is contained in:
CanbiZ 2025-08-06 11:31:46 +02:00
parent 201208bfe5
commit 7d38e46ba2

View File

@ -57,6 +57,11 @@ get_pve_major_minor() {
echo "$major $minor" echo "$major $minor"
} }
component_exists_in_sources() {
local component="$1"
grep -h -E "^[^#]*Components:[^#]*\b${component}\b" /etc/apt/sources.list.d/*.sources 2>/dev/null | grep -q .
}
main() { main() {
header_info header_info
echo -e "\nThis script will Perform Post Install Routines.\n" echo -e "\nThis script will Perform Post Install Routines.\n"
@ -270,6 +275,10 @@ EOF
esac esac
fi fi
# ---- PVE-ENTERPRISE ----
if component_exists_in_sources "pve-enterprise"; then
msg_ok "'pve-enterprise' repository already exists (skipped)"
else
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" \ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" \
--title "PVE-ENTERPRISE" \ --title "PVE-ENTERPRISE" \
--menu "The 'pve-enterprise' repository is only available to users who have purchased a Proxmox VE subscription.\n\nAdd 'pve-enterprise' repository (deb822)?" 14 58 2 \ --menu "The 'pve-enterprise' repository is only available to users who have purchased a Proxmox VE subscription.\n\nAdd 'pve-enterprise' repository (deb822)?" 14 58 2 \
@ -291,8 +300,14 @@ EOF
;; ;;
no) msg_error "Selected no to Adding 'pve-enterprise' repository" ;; no) msg_error "Selected no to Adding 'pve-enterprise' repository" ;;
esac esac
fi
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PVE-NO-SUBSCRIPTION" --menu "The 'pve-no-subscription' repository provides access to all of the open-source components of Proxmox VE.\n \nAdd 'pve-no-subscription' repository (deb822)?" 14 58 2 \ # ---- PVE-NO-SUBSCRIPTION ----
if component_exists_in_sources "pve-no-subscription"; then
msg_ok "'pve-no-subscription' repository already exists (skipped)"
else
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PVE-NO-SUBSCRIPTION" \
--menu "The 'pve-no-subscription' repository provides access to all of the open-source components of Proxmox VE.\n\nAdd 'pve-no-subscription' repository (deb822)?" 14 58 2 \
"yes" " " \ "yes" " " \
"no" " " 3>&2 2>&1 1>&3) "no" " " 3>&2 2>&1 1>&3)
case $CHOICE in case $CHOICE in
@ -309,8 +324,14 @@ EOF
;; ;;
no) msg_error "Selected no to Adding 'pve-no-subscription' repository" ;; no) msg_error "Selected no to Adding 'pve-no-subscription' repository" ;;
esac esac
fi
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "CEPH PACKAGE REPOSITORIES" --menu "The 'Ceph Package Repositories' provides access to both the 'no-subscription' and 'enterprise' repositories (deb822).\n \nAdd 'ceph package sources?" 14 58 2 \ # ---- CEPH ----
if component_exists_in_sources "no-subscription"; then
msg_ok "'ceph' package repository (no-subscription) already exists (skipped)"
else
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "CEPH PACKAGE REPOSITORIES" \
--menu "The 'Ceph Package Repositories' provides access to both the 'no-subscription' and 'enterprise' repositories (deb822).\n\nAdd 'ceph package sources?" 14 58 2 \
"yes" " " \ "yes" " " \
"no" " " 3>&2 2>&1 1>&3) "no" " " 3>&2 2>&1 1>&3)
case $CHOICE in case $CHOICE in
@ -327,8 +348,14 @@ EOF
;; ;;
no) msg_error "Selected no to Adding 'ceph package repositories'" ;; no) msg_error "Selected no to Adding 'ceph package repositories'" ;;
esac esac
fi
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PVETEST" --menu "The 'pvetest' repository can give advanced users access to new features and updates before they are officially released.\n \nAdd (Disabled) 'pvetest' repository (deb822)?" 14 58 2 \ # ---- PVETEST ----
if component_exists_in_sources "pvetest"; then
msg_ok "'pvetest' repository already exists (skipped)"
else
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PVETEST" \
--menu "The 'pvetest' repository can give advanced users access to new features and updates before they are officially released.\n\nAdd (Disabled) 'pvetest' repository (deb822)?" 14 58 2 \
"yes" " " \ "yes" " " \
"no" " " 3>&2 2>&1 1>&3) "no" " " 3>&2 2>&1 1>&3)
case $CHOICE in case $CHOICE in
@ -345,6 +372,7 @@ EOF
;; ;;
no) msg_error "Selected no to Adding 'pvetest' repository" ;; no) msg_error "Selected no to Adding 'pvetest' repository" ;;
esac esac
fi
post_routines_common post_routines_common
} }
@ -427,12 +455,13 @@ post_routines_common() {
# Final message for all hosts in cluster and browser cache # Final message for all hosts in cluster and browser cache
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Post-Install Reminder" --msgbox \ whiptail --backtitle "Proxmox VE Helper Scripts" --title "Post-Install Reminder" --msgbox \
"IMPORTANT: "IMPORTANT:
If you have multiple Proxmox VE hosts in a cluster, please make sure to run this script on every node individually. If you have multiple Proxmox VE hosts in a cluster, please make sure to run this script on every node individually.
After completing these steps, it is strongly recommended to REBOOT your node. After completing these steps, it is strongly recommended to REBOOT your node.
After the upgrade or post-install routines, always clear your browser cache or perform a hard reload (Ctrl+Shift+R) before using the Proxmox VE Web UI to avoid UI display issues. After the upgrade or post-install routines, always clear your browser cache or perform a hard reload (Ctrl+Shift+R) before using the Proxmox VE Web UI to avoid UI display issues.
" 14 70 " 20 80
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "REBOOT" --menu "\nReboot Proxmox VE now? (recommended)" 11 58 2 \ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "REBOOT" --menu "\nReboot Proxmox VE now? (recommended)" 11 58 2 \
"yes" " " \ "yes" " " \