From 259ba993a22197d1bc406f4ee6c309f6a444fbdf Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 8 Mar 2023 14:55:40 -0500 Subject: [PATCH] Update post-pve-install.sh tweak --- misc/post-pve-install.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/misc/post-pve-install.sh b/misc/post-pve-install.sh index 0cd732f6..8404bc56 100644 --- a/misc/post-pve-install.sh +++ b/misc/post-pve-install.sh @@ -66,15 +66,15 @@ function msg_ok() { clear header_info read -r -p "Disable Enterprise Repository? " prompt -if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Disabling Enterprise Repository" sleep 2 - sed -i "s/^deb/#deb/g" /etc/apt/sources.list.d/pve-enterprise.list + 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 -if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Adding or Correcting PVE7 Sources" cat </etc/apt/sources.list deb http://ftp.debian.org/debian bullseye main contrib @@ -85,8 +85,9 @@ EOF msg_ok "Added or Corrected PVE7 Sources" fi + read -r -p "Enable No-Subscription Repository? " prompt -if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Enabling No-Subscription Repository" cat <>/etc/apt/sources.list deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription @@ -96,7 +97,7 @@ EOF fi read -r -p "Add (Disabled) Beta/Test Repository? " prompt -if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Adding Beta/Test Repository and set disabled" cat <>/etc/apt/sources.list # deb http://download.proxmox.com/debian/pve bullseye pvetest @@ -106,7 +107,7 @@ EOF fi read -r -p "Disable Subscription Nag? " prompt -if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Disabling Subscription Nag" 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 apt --reinstall install proxmox-widget-toolkit &>/dev/null @@ -114,7 +115,7 @@ if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ] fi read -r -p "Update Proxmox VE 7 now? " prompt -if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Updating Proxmox VE 7 (Patience)" apt-get update &>/dev/null apt-get -y dist-upgrade &>/dev/null @@ -122,7 +123,7 @@ if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ] fi read -r -p "Reboot Proxmox VE 7 now? " prompt -if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Rebooting Proxmox VE 7" sleep 2 msg_ok "Completed Post Install Routines"