post_install.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env bash
  2. echo -e "\e[1;33m This script will Setup Repositories and attempt the No-Nag fix. PVE7 ONLY \e[0m"
  3. while true; do
  4. read -p "Start the PVE7 Post Install Script (y/n)?" yn
  5. case $yn in
  6. [Yy]* ) break;;
  7. [Nn]* ) exit;;
  8. * ) echo "Please answer yes or no.";;
  9. esac
  10. done
  11. if [ `pveversion | grep "pve-manager/7" | wc -l` -ne 1 ]; then
  12. echo -e "This script requires Proxmox Virtual Environment 7.0 or greater"
  13. echo -e "Exiting..."
  14. sleep 2
  15. exit
  16. fi
  17. clear
  18. echo -e "\e[1;33m Disable Enterprise Repository... \e[0m"
  19. sleep 1
  20. sed -i "s/^deb/#deb/g" /etc/apt/sources.list.d/pve-enterprise.list
  21. echo -e "\e[1;33m Setup Repositories... \e[0m"
  22. sleep 1
  23. cat <<EOF > /etc/apt/sources.list
  24. deb http://ftp.debian.org/debian bullseye main contrib
  25. deb http://ftp.debian.org/debian bullseye-updates main contrib
  26. deb http://security.debian.org/debian-security bullseye-security main contrib
  27. deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
  28. # deb http://download.proxmox.com/debian/pve bullseye pvetest
  29. EOF
  30. echo -e "\e[1;33m Disable Subscription Nag... \e[0m"
  31. 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
  32. apt --reinstall install proxmox-widget-toolkit &>/dev/null
  33. echo -e "\e[1;33m Finished....Please Update Proxmox \e[0m"
  34. # bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/misc/post_install.sh)"