Update post-pve-install.sh

Requires Proxmox Virtual Environment Version 8.1.1 or later.
This commit is contained in:
tteckster 2024-03-08 17:09:11 -05:00 committed by GitHub
parent b58ae2b892
commit 78bc2006bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 12 deletions

View File

@ -46,7 +46,6 @@ msg_error() {
start_routines() { start_routines() {
header_info header_info
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SOURCES" --menu "The package manager will use the correct sources to update and install packages on your Proxmox VE server.\n \nCorrect Proxmox VE sources?" 14 58 2 \ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SOURCES" --menu "The package manager will use the correct sources to update and install packages on your Proxmox VE server.\n \nCorrect Proxmox VE sources?" 14 58 2 \
"yes" " " \ "yes" " " \
@ -55,10 +54,11 @@ start_routines() {
yes) yes)
msg_info "Correcting Proxmox VE Sources" msg_info "Correcting Proxmox VE Sources"
cat <<EOF >/etc/apt/sources.list cat <<EOF >/etc/apt/sources.list
deb http://ftp.debian.org/debian ${VERSION} main contrib deb http://deb.debian.org/debian bookworm main contrib
deb http://ftp.debian.org/debian ${VERSION}-updates main contrib deb http://deb.debian.org/debian bookworm-updates main contrib
deb http://security.debian.org/debian-security ${VERSION}-security main contrib deb http://security.debian.org/debian-security bookworm-security main contrib
EOF EOF
echo 'APT::Get::Update::SourceListWarnings::NonFreeFirmware "false";' >/etc/apt/apt.conf.d/no-bookworm-firmware.conf
msg_ok "Corrected Proxmox VE Sources" msg_ok "Corrected Proxmox VE Sources"
;; ;;
no) no)
@ -73,7 +73,7 @@ EOF
yes) yes)
msg_info "Disabling 'pve-enterprise' repository" msg_info "Disabling 'pve-enterprise' repository"
cat <<EOF >/etc/apt/sources.list.d/pve-enterprise.list cat <<EOF >/etc/apt/sources.list.d/pve-enterprise.list
# deb https://enterprise.proxmox.com/debian/pve ${VERSION} pve-enterprise # deb https://enterprise.proxmox.com/debian/pve bookworm pve-enterprise
EOF EOF
msg_ok "Disabled 'pve-enterprise' repository" msg_ok "Disabled 'pve-enterprise' repository"
;; ;;
@ -89,7 +89,7 @@ EOF
yes) yes)
msg_info "Enabling 'pve-no-subscription' repository" msg_info "Enabling 'pve-no-subscription' repository"
cat <<EOF >/etc/apt/sources.list.d/pve-install-repo.list cat <<EOF >/etc/apt/sources.list.d/pve-install-repo.list
deb http://download.proxmox.com/debian/pve ${VERSION} pve-no-subscription deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
EOF EOF
msg_ok "Enabled 'pve-no-subscription' repository" msg_ok "Enabled 'pve-no-subscription' repository"
;; ;;
@ -98,7 +98,6 @@ EOF
;; ;;
esac esac
if [[ "${VERSION}" == "bookworm" ]]; then
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 (initially disabled).\n \nCorrect 'ceph package sources?" 14 58 2 \ 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 (initially disabled).\n \nCorrect 'ceph package sources?" 14 58 2 \
"yes" " " \ "yes" " " \
"no" " " 3>&2 2>&1 1>&3) "no" " " 3>&2 2>&1 1>&3)
@ -117,7 +116,6 @@ EOF
msg_error "Selected no to Correcting 'ceph package repositories'" msg_error "Selected no to Correcting '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?" 14 58 2 \ 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?" 14 58 2 \
"yes" " " \ "yes" " " \
@ -126,7 +124,7 @@ EOF
yes) yes)
msg_info "Adding 'pvetest' repository and set disabled" msg_info "Adding 'pvetest' repository and set disabled"
cat <<EOF >/etc/apt/sources.list.d/pvetest-for-beta.list cat <<EOF >/etc/apt/sources.list.d/pvetest-for-beta.list
# deb http://download.proxmox.com/debian/pve ${VERSION} pvetest # deb http://download.proxmox.com/debian/pve bookworm pvetest
EOF EOF
msg_ok "Added 'pvetest' repository" msg_ok "Added 'pvetest' repository"
;; ;;
@ -233,9 +231,11 @@ while true; do
esac esac
done done
if ! command -v pveversion >/dev/null 2>&1; then if ! pveversion | grep -Eq "pve-manager/(8.1.[1-9])"; then
header_info msg_error "This version of Proxmox Virtual Environment is not supported"
msg_error "\n No PVE Detected!\n" echo -e "Requires Proxmox Virtual Environment Version 8.1.1 or later."
echo -e "Exiting..."
sleep 2
exit exit
fi fi