mirror of
https://github.com/andrewpayne68/proxmox-nag-buster.git
synced 2025-01-18 16:37:51 +00:00
Moved pve-no-subscription.list creation to install.sh - it only has to run once anyway
This commit is contained in:
parent
180633e4c6
commit
1b12f21356
14
install.sh
Normal file → Executable file
14
install.sh
Normal file → Executable file
|
@ -19,6 +19,20 @@
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
RELEASE=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release)
|
||||||
|
|
||||||
|
# create the pve-no-subscription list
|
||||||
|
|
||||||
|
echo "$0: Creating PVE no-subscription repo list ..."
|
||||||
|
cat <<EOF>"/etc/apt/sources.list.d/pve-no-subscription.list"
|
||||||
|
# .list file automatically generated by pve-nag-buster:$0 at $(date)
|
||||||
|
#
|
||||||
|
# If $0 is run again this file will likely be overwritten
|
||||||
|
#
|
||||||
|
|
||||||
|
deb http://download.proxmox.com/debian/pve $RELEASE pve-no-subscription
|
||||||
|
EOF
|
||||||
|
|
||||||
# create dpkg pre/post install hooks for persistence
|
# create dpkg pre/post install hooks for persistence
|
||||||
|
|
||||||
cat <<'EOF' >/etc/apt/apt.conf.d/86pve-nags
|
cat <<'EOF' >/etc/apt/apt.conf.d/86pve-nags
|
||||||
|
|
17
pve-nag-buster.sh
Normal file → Executable file
17
pve-nag-buster.sh
Normal file → Executable file
|
@ -17,7 +17,6 @@
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
RELEASE=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release)
|
|
||||||
NAGTOKEN="data.status !== 'Active'"
|
NAGTOKEN="data.status !== 'Active'"
|
||||||
NAGFILE="/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js"
|
NAGFILE="/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js"
|
||||||
|
|
||||||
|
@ -29,21 +28,11 @@ if $(grep -q "$NAGTOKEN" "$NAGFILE") ; then
|
||||||
systemctl restart pveproxy.service
|
systemctl restart pveproxy.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PAID_BASE="/etc/apt/sources.list.d/pve-enterprise"
|
# disable paid repo list
|
||||||
FREE_LIST="/etc/apt/sources.list.d/pve-no-subscription.list"
|
|
||||||
|
|
||||||
# switch to pve-no-subscription repo
|
PAID_BASE="/etc/apt/sources.list.d/pve-enterprise"
|
||||||
|
|
||||||
if [ -f "$PAID_BASE.list" ]; then
|
if [ -f "$PAID_BASE.list" ]; then
|
||||||
echo "$0: Updating PVE repo lists ..."
|
echo "$0: Disabling PVE paid repo list ..."
|
||||||
mv -f "$PAID_BASE.list" "$PAID_BASE.disabled"
|
mv -f "$PAID_BASE.list" "$PAID_BASE.disabled"
|
||||||
cat <<EOF>"$FREE_LIST"
|
|
||||||
# .list file automatically generated by $0 at $(date)
|
|
||||||
#
|
|
||||||
# Do not edit this file by hand, it will be overwritten
|
|
||||||
#
|
|
||||||
|
|
||||||
deb http://download.proxmox.com/debian/pve $RELEASE pve-no-subscription
|
|
||||||
EOF
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue