Update post-pve-install.sh

give the option to disable high availability in a non-clustered environment
This commit is contained in:
tteckster 2023-06-02 11:55:20 -04:00 committed by GitHub
parent afbbb011d6
commit e6deb6c79a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ msg_error() {
start_routines() { start_routines() {
header_info header_info
CHOICE=$(whiptail --title "Proxmox VE 7 Post Install" --menu "The 'pve-enterprise' repository is only available to users who have purchased a Proxmox VE subscription.\n \nDisable 'pve-enterprise' repository?" 14 58 2 \ CHOICE=$(whiptail --title "PVE-ENTERPRISE" --menu "The 'pve-enterprise' repository is only available to users who have purchased a Proxmox VE subscription.\n \nDisable 'pve-enterprise' repository?" 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
@ -61,7 +61,7 @@ start_routines() {
;; ;;
esac esac
CHOICE=$(whiptail --title "Proxmox VE 7 Post Install" --menu "The package manager will use the correct sources to update and install packages on your Proxmox VE 7 server.\n \nCorrect Proxmox VE 7 sources?" 14 58 2 \ CHOICE=$(whiptail --title "SOURCES" --menu "The package manager will use the correct sources to update and install packages on your Proxmox VE 7 server.\n \nCorrect Proxmox VE 7 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
@ -79,7 +79,7 @@ EOF
;; ;;
esac esac
CHOICE=$(whiptail --title "Proxmox VE 7 Post Install" --menu "The 'pve-no-subscription' repository provides access to all of the open-source components of Proxmox VE.\n \nEnable 'pve-no-subscription' repository?" 14 58 2 \ CHOICE=$(whiptail --title "PVE-NO-SUBSCRIPTION" --menu "The 'pve-no-subscription' repository provides access to all of the open-source components of Proxmox VE.\n \nEnable 'pve-no-subscription' repository?" 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
@ -95,7 +95,7 @@ EOF
;; ;;
esac esac
CHOICE=$(whiptail --title "Proxmox VE 7 Post Install" --menu "The 'pvetest' repository can give advanced users access to new features and updates before they are officially released.\n \nAdd (Disabled) 'pvetest' repository?" 14 58 2 \ CHOICE=$(whiptail --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?" 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
@ -111,22 +111,45 @@ EOF
;; ;;
esac esac
CHOICE=$(whiptail --title "Proxmox VE 7 Post Install" --menu "This will disable the nag message reminding you to purchase a subscription every time you log in to the web interface.\n \nDisable subscription nag?" 14 58 2 \ if [[ ! -f /etc/apt/apt.conf.d/no-nag-script ]]; then
"yes" " " \ CHOICE=$(whiptail --title "SUBSCRIPTION NAG" --menu "This will disable the nag message reminding you to purchase a subscription every time you log in to the web interface.\n \nDisable subscription nag?" 14 58 2 \
"no" " " 3>&2 2>&1 1>&3) "yes" " " \
case $CHOICE in "no" " " 3>&2 2>&1 1>&3)
yes) case $CHOICE in
msg_info "Disabling subscription nag" yes)
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data\.status.*{/{s/\!//;s/active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" >/etc/apt/apt.conf.d/no-nag-script msg_info "Disabling subscription nag"
apt --reinstall install proxmox-widget-toolkit &>/dev/null echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data\.status.*{/{s/\!//;s/active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" >/etc/apt/apt.conf.d/no-nag-script
msg_ok "Disabled subscription nag (Delete browser cache)" apt --reinstall install proxmox-widget-toolkit &>/dev/null
;; msg_ok "Disabled subscription nag (Delete browser cache)"
no) ;;
msg_error "Selected no to Disabling subscription nag" no)
;; msg_error "Selected no to Disabling subscription nag"
esac ;;
esac
fi
CHOICE=$(whiptail --title "Proxmox VE 7 Post Install" --menu "\nUpdate Proxmox VE 7 now?" 11 58 2 \ if systemctl is-active --quiet pve-ha-lrm; then
CHOICE=$(whiptail --title "HIGH AVAILABILITY" --menu "If you plan to utilize a single node instead of a clustered environment, you can disable unnecessary high availability (HA) services, thus reclaiming system resources.\n\nIf HA becomes necessary at a later stage, the services can be re-enabled.\n\nDisable high availability?" 18 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Disabling high availability"
systemctl stop pve-ha-lrm
systemctl disable pve-ha-lrm &>/dev/null
systemctl stop pve-ha-crm
systemctl disable pve-ha-crm &>/dev/null
systemctl stop corosync
systemctl disable corosync &>/dev/null
msg_ok "Disabled high availability"
;;
no)
msg_error "Selected no to Disabling high availability"
;;
esac
fi
CHOICE=$(whiptail --title "UPDATE" --menu "\nUpdate Proxmox VE 7 now?" 11 58 2 \
"yes" " " \ "yes" " " \
"no" " " 3>&2 2>&1 1>&3) "no" " " 3>&2 2>&1 1>&3)
case $CHOICE in case $CHOICE in
@ -178,7 +201,7 @@ EOF
esac esac
fi fi
CHOICE=$(whiptail --title "Proxmox VE 7 Post Install" --menu "\nReboot Proxmox VE 7 now? (recommended)" 11 58 2 \ CHOICE=$(whiptail --title "REBOOT" --menu "\nReboot Proxmox VE 7 now? (recommended)" 11 58 2 \
"yes" " " \ "yes" " " \
"no" " " 3>&2 2>&1 1>&3) "no" " " 3>&2 2>&1 1>&3)
case $CHOICE in case $CHOICE in