From 4a5a609e26237e42826fa6fada88278a7c9d6412 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 23 Aug 2022 21:37:12 -0400 Subject: [PATCH] Update post-install.sh --- misc/post-install.sh | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/misc/post-install.sh b/misc/post-install.sh index 14c0dcc2..73c32268 100644 --- a/misc/post-install.sh +++ b/misc/post-install.sh @@ -12,8 +12,8 @@ BFR="\\r\\033[K" HOLD="-" CM="${GN}✓${CL}" CROSS="${RD}✗${CL}" - -echo -e "\e[1;33m This script will Perform Post Install Routines. PVE7 ONLY \e[0m" +clear +echo -e "${BL}This script will Perform Post Install Routines.${CL}" while true; do read -p "Start the PVE7 Post Install Script (y/n)?" yn case $yn in @@ -23,11 +23,11 @@ while true; do esac done if [ `pveversion | grep "pve-manager/7" | wc -l` -ne 1 ]; then - echo "⚠ This version of Proxmox Virtual Environment is not supported" - echo "Requires PVE Version: 7.XX" - echo "Exiting..." - sleep 3 - exit + echo -e "\n${RD}⚠ This version of Proxmox Virtual Environment is not supported" + echo -e "Requires PVE Version: 7.XX${CL}" + echo -e "\nExiting..." + sleep 3 + exit fi function header_info { echo -e "${RD} @@ -51,7 +51,7 @@ function msg_ok() { clear header_info -read -r -p "Disable Enterprise Repository? " prompt +read -r -p "Disable Enterprise Repository? " prompt if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] then msg_info "Disabling Enterprise Repository" @@ -60,7 +60,7 @@ sed -i "s/^deb/#deb/g" /etc/apt/sources.list.d/pve-enterprise.list msg_ok "Disabled Enterprise Repository" fi -read -r -p "Add/Correct PVE7 Sources (sources.list)? " prompt +read -r -p "Add/Correct PVE7 Sources (sources.list)? " prompt if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] then msg_info "Adding or Correcting PVE7 Sources" @@ -73,7 +73,7 @@ sleep 2 msg_ok "Added or Corrected PVE7 Sources" fi -read -r -p "Enable No-Subscription Repository? " prompt +read -r -p "Enable No-Subscription Repository? " prompt if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] then msg_info "Enabling No-Subscription Repository" @@ -84,7 +84,7 @@ sleep 2 msg_ok "Enabled No-Subscription Repository" fi -read -r -p "Add (Disabled) Beta/Test Repository? " prompt +read -r -p "Add (Disabled) Beta/Test Repository? " prompt if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] then msg_info "Adding Beta/Test Repository and set disabled" @@ -95,7 +95,7 @@ sleep 2 msg_ok "Added Beta/Test Repository" fi -read -r -p "Disable Subscription Nag? " prompt +read -r -p "Disable Subscription Nag? " prompt if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] then msg_info "Disabling Subscription Nag" @@ -104,7 +104,7 @@ apt --reinstall install proxmox-widget-toolkit &>/dev/null msg_ok "Disabled Subscription Nag" fi -read -r -p "Update Proxmox VE 7 now? " prompt +read -r -p "Update Proxmox VE 7 now? " prompt if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] then msg_info "Updating Proxmox VE 7 (Patience)" @@ -113,5 +113,14 @@ apt-get -y dist-upgrade &>/dev/null msg_ok "Updated Proxmox VE 7 (⚠ Reboot Recommended)" fi +read -r -p "Reboot Proxmox VE 7 now? " prompt +if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] +then +msg_info "Rebooting Proxmox VE 7" +sleep 2 +msg_ok "Completed Post Install Routines" +reboot +fi + sleep 2 msg_ok "Completed Post Install Routines"