post_install.sh 1.4 KB

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env bash
  2. echo -e "\e[1;33m This script will Disable the Enterprise Repo, Add & Enable the No-Subscription Repo,
  3. Add & Disable Test Repo (repo's can be enabled/disabled via the UI in Repositories)
  4. and attempt the No-Nag fix. PVE7 ONLY \e[0m"
  5. while true; do
  6. read -p "Start the PVE7 Post Install Script (y/n)?" yn
  7. case $yn in
  8. [Yy]* ) break;;
  9. [Nn]* ) exit;;
  10. * ) echo "Please answer yes or no.";;
  11. esac
  12. done
  13. sed -i "s/^deb/#deb/g" /etc/apt/sources.list.d/pve-enterprise.list
  14. cat <<EOF > /etc/apt/sources.list
  15. deb http://ftp.debian.org/debian bullseye main contrib
  16. deb http://ftp.debian.org/debian bullseye-updates main contrib
  17. deb http://security.debian.org/debian-security bullseye-security main contrib
  18. deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
  19. # deb http://download.proxmox.com/debian/pve bullseye pvetest
  20. EOF
  21. 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
  22. apt --reinstall install proxmox-widget-toolkit &>/dev/null
  23. echo -e "\e[1;33m Finished....Please Update Proxmox \e[0m"
  24. # bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/misc/post_install.sh)"