Update and rename pve8-post-install.sh to pve-post-install.sh

combine pve7 & pve8 post install scripts
This commit is contained in:
tteckster 2023-06-11 22:49:42 -04:00 committed by GitHub
parent e8ff5b6540
commit 9e27e19746
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,11 +8,11 @@
header_info() {
clear
cat <<"EOF"
____ _ ____________ ____ __ ____ __ ____
/ __ \ | / / ____( __ ) / __ \____ _____/ /_ / _/___ _____/ /_____ _/ / /
/ /_/ / | / / __/ / __ | / /_/ / __ \/ ___/ __/ / // __ \/ ___/ __/ __ `/ / /
/ ____/| |/ / /___/ /_/ / / ____/ /_/ (__ ) /_ _/ // / / (__ ) /_/ /_/ / / /
/_/ |___/_____/\____/ /_/ \____/____/\__/ /___/_/ /_/____/\__/\__,_/_/_/
____ _ ________ ____ __ ____ __ ____
/ __ \ | / / ____/ / __ \____ _____/ /_ / _/___ _____/ /_____ _/ / /
/ /_/ / | / / __/ / /_/ / __ \/ ___/ __/ / // __ \/ ___/ __/ __ `/ / /
/ ____/| |/ / /___ / ____/ /_/ (__ ) /_ _/ // / / (__ ) /_/ /_/ / / /
/_/ |___/_____/ /_/ \____/____/\__/ /___/_/ /_/____/\__/\__,_/_/_/
EOF
}
@ -44,25 +44,28 @@ msg_error() {
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
}
start_routines() {
header_info
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
if lscpu | grep -qP 'Vendor ID:.*GenuineIntel' && lscpu | grep -qP 'Model name:.*N' && [[ "$VERSION" == "bullseye" ]]; then
whiptail --msgbox --title "N-SERIES PROCESSOR DETECTED" "To ensure compatibility with Proxmox VE on systems equipped with N-series processors, it is recommended to install Proxmox Virtual Environment 8" 10 58
fi
CHOICE=$(whiptail --title "SOURCES" --menu "The package manager will use the correct sources to update and install packages on your Proxmox VE 8 server.\n \nCorrect Proxmox VE 8 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 server.\n \nCorrect Proxmox VE sources?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Correcting Proxmox VE 8 Sources"
msg_info "Correcting Proxmox VE Sources"
cat <<EOF >/etc/apt/sources.list
deb http://ftp.debian.org/debian bookworm main contrib
deb http://ftp.debian.org/debian bookworm-updates main contrib
deb http://security.debian.org/debian-security bookworm-security main contrib
deb http://ftp.debian.org/debian $(VERSION) main contrib
deb http://ftp.debian.org/debian $(VERSION)-updates main contrib
deb http://security.debian.org/debian-security $(VERSION)-security main contrib
EOF
msg_ok "Corrected Proxmox VE 8 Sources"
msg_ok "Corrected Proxmox VE Sources"
;;
no)
msg_error "Selected no to Correcting Proxmox VE 8 Sources"
msg_error "Selected no to Correcting Proxmox VE Sources"
;;
esac
@ -73,7 +76,7 @@ EOF
yes)
msg_info "Disabling 'pve-enterprise' repository"
cat <<EOF >/etc/apt/sources.list.d/pve-enterprise.list
# deb https://enterprise.proxmox.com/debian/pve bookworm pve-enterprise
# deb https://enterprise.proxmox.com/debian/pve $(VERSION) pve-enterprise
EOF
msg_ok "Disabled 'pve-enterprise' repository"
;;
@ -89,7 +92,7 @@ EOF
yes)
msg_info "Enabling 'pve-no-subscription' repository"
cat <<EOF >/etc/apt/sources.list.d/pve-install-repo.list
deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
deb http://download.proxmox.com/debian/pve $(VERSION) pve-no-subscription
EOF
msg_ok "Enabled 'pve-no-subscription' repository"
;;
@ -98,6 +101,7 @@ EOF
;;
esac
if [[ "$(VERSION)" == "bookworm" ]]; then
CHOICE=$(whiptail --title "CEPH PACKAGE REPOSITORIES" --menu "The 'Ceph Package Repositories' provides access to both the 'no-subscription' and 'enterprise' repositories.\n \nEnable 'ceph package repositories?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
@ -114,6 +118,7 @@ EOF
msg_error "Selected no to Enabling 'ceph package repositories'"
;;
esac
fi
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" " " \
@ -122,7 +127,7 @@ EOF
yes)
msg_info "Adding 'pvetest' repository and set disabled"
cat <<EOF >/etc/apt/sources.list.d/pvetest-for-beta.list
# deb http://download.proxmox.com/debian/pve bookworm pvetest
# deb http://download.proxmox.com/debian/pve $(VERSION) pvetest
EOF
msg_ok "Added 'pvetest' repository"
;;
@ -171,33 +176,33 @@ EOF
esac
fi
CHOICE=$(whiptail --title "UPDATE" --menu "\nUpdate Proxmox VE 8 now?" 11 58 2 \
CHOICE=$(whiptail --title "UPDATE" --menu "\nUpdate Proxmox VE now?" 11 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Updating Proxmox VE 8 (Patience)"
msg_info "Updating Proxmox VE (Patience)"
apt-get update &>/dev/null
apt-get -y dist-upgrade &>/dev/null
msg_ok "Updated Proxmox VE 8"
msg_ok "Updated Proxmox VE"
;;
no)
msg_error "Selected no to Updating Proxmox VE 8"
msg_error "Selected no to Updating Proxmox VE"
;;
esac
CHOICE=$(whiptail --title "REBOOT" --menu "\nReboot Proxmox VE 8 now? (recommended)" 11 58 2 \
CHOICE=$(whiptail --title "REBOOT" --menu "\nReboot Proxmox VE now? (recommended)" 11 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Rebooting Proxmox VE 8"
msg_info "Rebooting Proxmox VE"
sleep 2
msg_ok "Completed Post Install Routines"
reboot
;;
no)
msg_error "Selected no to Rebooting Proxmox VE 8 (Reboot recommended)"
msg_error "Selected no to Rebooting Proxmox VE (Reboot recommended)"
msg_ok "Completed Post Install Routines"
;;
esac
@ -206,7 +211,7 @@ EOF
header_info
echo -e "\nThis script will Perform Post Install Routines.\n"
while true; do
read -p "Start the Proxmox VE 8 Post Install Script (y/n)?" yn
read -p "Start the Proxmox VE Post Install Script (y/n)?" yn
case $yn in
[Yy]*) break ;;
[Nn]*) clear; exit ;;
@ -220,13 +225,4 @@ if ! command -v pveversion >/dev/null 2>&1; then
exit
fi
if [ $(pveversion | grep "pve-manager/8" | wc -l) -ne 1 ]; then
header_info
msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e " Requires PVE Version: 8.XX"
echo -e "\nExiting..."
sleep 3
exit
fi
start_routines