From 8abeca080d63953ce118beec59b9da3dc02cc942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Butz?= <67107050+MAButz@users.noreply.github.com> Date: Mon, 17 Oct 2022 16:27:27 +0200 Subject: [PATCH 1/2] Update proxmox-zfs-postinstall.sh --- proxmox-zfs-postinstall.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/proxmox-zfs-postinstall.sh b/proxmox-zfs-postinstall.sh index 7df1062..da83dd1 100644 --- a/proxmox-zfs-postinstall.sh +++ b/proxmox-zfs-postinstall.sh @@ -165,16 +165,23 @@ fi ###### INSTALLER SECTION ###### # disable pve-enterprise repo and add pve-no-subscription repo -if [[ "$(uname -r)" == *"-pve" ]]; then - echo "Deactivating pve-enterprise repository" - mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak > /dev/null 2>&1 - echo "Activating pve-no-subscription repository" - q=$(cat /etc/apt/sources.list | grep "pve-no-subscription") - if [ $? -gt 0 ]; then - echo "deb http://download.proxmox.com/debian/pve $VERSION_CODENAME pve-no-subscription" >> /etc/apt/sources.list + +#Not tested, yet! +read -p "Do you want to disable pve-enterprise repo and add pve-no-subscription repo (y/n)? " response + +if [ "$response" == "y" ]; then + if [[ "$(uname -r)" == *"-pve" ]]; then + echo "Deactivating pve-enterprise repository" + mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak > /dev/null 2>&1 + echo "Activating pve-no-subscription repository" + q=$(cat /etc/apt/sources.list | grep "pve-no-subscription") + if [ $? -gt 0 ]; then + echo "deb http://download.proxmox.com/debian/pve $VERSION_CODENAME pve-no-subscription" >> /etc/apt/sources.list + fi + rm -f /etc/apt/sources.list.d/pve-no-subscription.list fi - rm -f /etc/apt/sources.list.d/pve-no-subscription.list fi + echo "Getting latest package lists" apt update > /dev/null 2>&1 From b46d8c0a3952e123a3901e19edaecf60aaf187f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Butz?= <67107050+MAButz@users.noreply.github.com> Date: Tue, 18 Oct 2022 16:21:43 +0200 Subject: [PATCH 2/2] Update proxmox-zfs-postinstall.sh Suggested from teissler: -change (y/n)? to (y/N)? ;This way it is easier to understand that everything except "y" doesn't enables the pve-no-subscription repo. -$response to lowercase ;would also improve the scripts failure proofness. --- proxmox-zfs-postinstall.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxmox-zfs-postinstall.sh b/proxmox-zfs-postinstall.sh index da83dd1..51705a8 100644 --- a/proxmox-zfs-postinstall.sh +++ b/proxmox-zfs-postinstall.sh @@ -167,9 +167,9 @@ fi # disable pve-enterprise repo and add pve-no-subscription repo #Not tested, yet! -read -p "Do you want to disable pve-enterprise repo and add pve-no-subscription repo (y/n)? " response +read -p "Do you want to disable pve-enterprise repo and add pve-no-subscription repo (y/N)? " response -if [ "$response" == "y" ]; then +if [ "${response,,}" == "y" ]; then if [[ "$(uname -r)" == *"-pve" ]]; then echo "Deactivating pve-enterprise repository" mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak > /dev/null 2>&1