CHOICE=$(whiptail --title "PBS SOURCES" --menu "This will set the correct sources to update and install Proxmox Backup Server.\n \nChange to Proxmox Backup Server sources?"14582\
"yes"" "\
"no"" " 3>&2 2>&1 1>&3)
case$CHOICE in
yes)
msg_info "Changing to Proxmox Backup Server Sources"
cat <<EOF >/etc/apt/sources.list
deb http://ftp.debian.org/debian bullseye main contrib
deb http://ftp.debian.org/debian bullseye-updates main contrib
deb http://security.debian.org/debian-security bullseye-security main contrib
deb http://deb.debian.org/debian ${VERSION} main contrib
deb http://deb.debian.org/debian ${VERSION}-updates main contrib
deb http://security.debian.org/debian-security ${VERSION}-security main contrib
EOF
sleep 2
msg_ok "Added or Corrected PBS Sources"
fi
msg_ok "Changed to Proxmox Backup Server Sources"
;;
no)
msg_error "Selected no to Correcting Proxmox Backup Server Sources"
deb http://download.proxmox.com/debian/pbs bullseye pbs-no-subscription
CHOICE=$(whiptail --title "PBS-ENTERPRISE" --menu "The 'pbs-enterprise' repository is only available to users who have purchased a Proxmox VE subscription.\n \nDisable 'pbs-enterprise' repository?"14582\
msg_info "Adding Beta/Test Repository and set disabled"
cat <<EOF >>/etc/apt/sources.list
# deb http://download.proxmox.com/debian/pbs bullseye pbstest
CHOICE=$(whiptail --title "PBS-NO-SUBSCRIPTION" --menu "The 'pbs-no-subscription' repository provides access to all of the open-source components of Proxmox Backup Server.\n \nEnable 'pbs-no-subscription' repository?"14582\
CHOICE=$(whiptail --title "PBS TEST" --menu "The 'pbstest' repository can give advanced users access to new features and updates before they are officially released.\n \nAdd (Disabled) 'pbstest' repository?"14582\
"yes"" "\
"no"" " 3>&2 2>&1 1>&3)
case$CHOICE in
yes)
msg_info "Adding 'pbstest' repository and set disabled"
CHOICE=$(whiptail --title "SUBSCRIPTION NAG" --menu "This will disable the nag message reminding you to purchase a subscription every time you log in to the web interface.\n \nDisable subscription nag?"14582\
"yes"" "\
"no"" " 3>&2 2>&1 1>&3)
case$CHOICE in
yes)
whiptail --msgbox --title "Support Subscriptions""Supporting the software's development team is essential. Check their official website's Support Subscriptions for pricing. Without their dedicated work, we wouldn't have this exceptional software."1058
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
msg_ok "Disabled subscription nag (Delete browser cache)"
;;
no)
whiptail --msgbox --title "Support Subscriptions""Supporting the software's development team is essential. Check their official website's Support Subscriptions for pricing. Without their dedicated work, we wouldn't have this exceptional software."1058
msg_error "Selected no to Disabling subscription nag"
;;
esac
fi
CHOICE=$(whiptail --title "UPDATE" --menu "\nUpdate Proxmox Backup Server now?"11582\
"yes"" "\
"no"" " 3>&2 2>&1 1>&3)
case$CHOICE in
yes)
msg_info "Updating Proxmox Backup Server (Patience)"
apt-get update &>/dev/null
apt-get -y dist-upgrade &>/dev/null
msg_ok "Updated Proxmox Backup Server (⚠ Reboot Recommended)"
fi
msg_ok "Updated Proxmox Backup Server"
;;
no)
msg_error "Selected no to Updating Proxmox Backup Server"