Skip to content

Commit

Permalink
Update pbs_nosubscription_noenterprisesources_update.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Tontonjo authored Dec 21, 2020
1 parent 4f3951d commit 02ab712
Showing 1 changed file with 6 additions and 41 deletions.
47 changes: 6 additions & 41 deletions pbs_nosubscription_noenterprisesources_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
# You can run this scritp directly using:
# wget -O - https://raw.githubusercontent.com/Tontonjo/proxmox/master/pbs_nosubscription_noenterprisesources_update.sh | bash

varversion=1.5
varversion=1.6
# V1.0: Initial Release
# V1.2: fix repository names
# V1.3: Correct subscription removal
# V1.4: put license removal after update - makes more sense
# V1.5: added dist-upgrade to avoid bricking things
# V1.6: Redirect to new script - keeping cause link was shared.


# Sources:
Expand All @@ -25,44 +26,8 @@ varversion=1.5

# I assume you know what you are doing have a backup and have a default configuration.

echo "----------------------------------------------------------------"
echo "Tonton Jo - 2020"
echo "Proxmox subscription and sources inital setup V$varversion"
echo "----------------------------------------------------------------"
#1: Defining distribution name:

echo "- Defining distribution name for sources list"
distribution=$(. /etc/*-release;echo $VERSION_CODENAME)

#2: Edit sources list:

echo "- Checking Sources list"
if grep -Fxq "deb http://download.proxmox.com/debian/pbs $distribution pbs-no-subscription" /etc/apt/sources.list
then
echo "- Source looks alredy configured - Skipping"
else
echo "- Adding new entry to sources.list"
sed -i "\$adeb http://download.proxmox.com/debian/pbs $distribution pbs-no-subscription" /etc/apt/sources.list
fi

echo "- Checking Enterprise Source list"
if grep -Fxq "#deb https://enterprise.proxmox.com/debian/pbs $distribution pbs-enterprise" /etc/apt/sources.list.d/pbs-enterprise.list
then
echo "- Entreprise repo looks already commented - Skipping"
else
echo "- Hiding Enterprise sources list"
sed -i 's/^/#/' /etc/apt/sources.list.d/pbs-enterprise.list
fi


#3: update:
echo "- Updating System"
apt-get -qq update
apt-get -qq upgrade
apt-get -qq dist-upgrade

#4: Remove Subscription:

echo "- Removing No Valid Subscription Message"
sed -Ezi.bak "s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart proxmox-backup-proxy.service
echo "------------------------------------------------------------------------------------------------------------------------------"
echo "- Redirecting to new script at https://github.com/Tontonjo/proxmox/blob/master/pve_pbs_nosubscription_noenterprisesources.sh"
echo "------------------------------------------------------------------------------------------------------------------------------"

wget -O - https://raw.githubusercontent.com/Tontonjo/proxmox/master/pve_pbs_nosubscription_noenterprisesources.sh | bash

0 comments on commit 02ab712

Please sign in to comment.