mirror of
https://github.com/foundObjects/pve-nag-buster.git
synced 2025-08-13 16:42:22 +00:00
Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2228634e92 | ||
|
635801f829 | ||
|
f2d3a4cb3e | ||
|
8fe6439153 | ||
|
47e03508ef | ||
|
e5f86cb1b4 | ||
|
dd02dc0e59 | ||
|
7ace374dfe | ||
|
be8176180b | ||
|
c94ebe1cc4 | ||
|
235e99056f | ||
|
c567d211d5 | ||
|
27cf664aeb | ||
|
fe28b7c099 | ||
|
9f3a23fc88 | ||
|
674e924eaf | ||
|
a2608913e5 | ||
|
427b23b12c |
74
README.md
74
README.md
@ -1,19 +1,73 @@
|
|||||||
pve-nag-buster
|
## pve-nag-buster
|
||||||
Persistent license nag removal for Proxmox VE 5.x
|
https://github.com/foundObjects/pve-nag-buster
|
||||||
|
|
||||||
A bash script and dpkg pre/post install hooks to persistently remove the license nags from Proxmox VE 5.x.
|
`pve-nag-buster` is a dpkg hook script that persistently removes license nags
|
||||||
|
from Proxmox VE 6.x and up. Install it once and you won't see another license
|
||||||
|
nag until the Proxmox team changes their web-ui code in a way that breaks the patch.
|
||||||
|
|
||||||
The main script does two things: it removes the "unlicensed node" popup nag from the web gui and it switches repositories from pve-enterprise to pve-no-subscription. The script is called every time a package updates the web gui or the
|
Please support the Proxmox team by [buying a subscription](https://www.proxmox.com/en/proxmox-ve/pricing) if it's within your
|
||||||
pve-enterprise source list and will only run if packages containing those files are changed. There are no external dependencies beyond the base packages installed with PVE by default (awk, sed, grep, wget).
|
means. High quality open source software like Proxmox needs our support!
|
||||||
|
|
||||||
For your convenience the install script also contains a base64 encoded copy of pve-nag-buster.sh for use offline. I'd have just packed everything into install.sh by default but making everyone download, unxz and base64 decode a HEREDOC to look at my code seemed rude.
|
### News:
|
||||||
|
|
||||||
To install:
|
Last updated for: pve-manager/6.4-4/337d6701 (running kernel: 5.4.106-1-pve)
|
||||||
|
|
||||||
```
|
### How does it work?
|
||||||
|
|
||||||
|
The included hook script removes the "unlicensed node" popup nag from the web
|
||||||
|
gui and disables the pve-enterprise repository list. This script is called
|
||||||
|
every time a package updates the web gui or the pve-enterprise source list and
|
||||||
|
will only run if packages containing those files are changed.
|
||||||
|
|
||||||
|
The installer installs the dpkg hook script, adds the pve-no-subscription repo list
|
||||||
|
and calls the hook script once. There are no external dependencies beyond the base
|
||||||
|
packages installed with PVE by default.
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
```sh
|
||||||
wget https://raw.githubusercontent.com/foundObjects/pve-nag-buster/master/install.sh
|
wget https://raw.githubusercontent.com/foundObjects/pve-nag-buster/master/install.sh
|
||||||
# Read the script
|
|
||||||
chmod +x install.sh && ./install.sh
|
# Always read scripts downloaded from the internet before running them with sudo
|
||||||
|
sudo bash install.sh
|
||||||
|
|
||||||
|
# or ..
|
||||||
|
chmod +x install.sh && sudo ./install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
With Git:
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/foundObjects/pve-nag-buster.git
|
||||||
|
|
||||||
|
# Always read scripts downloaded from the internet before running them with sudo
|
||||||
|
cd pve-nag-buster && sudo ./install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Uninstall:
|
||||||
|
```sh
|
||||||
|
sudo ./install.sh --uninstall
|
||||||
|
# remove /etc/apt/sources.list.d/pve-no-subscription.list if desired
|
||||||
|
```
|
||||||
|
|
||||||
|
### Notes:
|
||||||
|
|
||||||
|
#### Why is there base64 in my peanut-butter?
|
||||||
|
|
||||||
|
For convenience the install script also contains a base64 encoded copy of the
|
||||||
|
hook script, this makes installation possible without access to github or a
|
||||||
|
full clone of the project directory.
|
||||||
|
|
||||||
|
To inspect the base64 encoded script run `./install.sh --emit`; this dumps the
|
||||||
|
encoded copy to stdout and quits. To install using the stored copy just run
|
||||||
|
`sudo ./install.sh --offline`, no internet required.
|
||||||
|
|
||||||
|
### Thanks to:
|
||||||
|
|
||||||
|
- John McLaren for his [blog post](https://www.reddit.com/user/seaqueue) documenting the web gui patch.
|
||||||
|
- [Marlin Sööse](https://github.com/msoose) for the update for PVE 6.3+
|
||||||
|
|
||||||
|
### Contact:
|
||||||
|
|
||||||
|
[Open an issue](https://github.com/foundObjects/pve-nag-buster/issues) on GitHub
|
||||||
|
|
||||||
Please get in touch if you find a way to improve anything, otherwise enjoy!
|
Please get in touch if you find a way to improve anything, otherwise enjoy!
|
||||||
|
|
||||||
|
199
install.sh
199
install.sh
@ -1,9 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
# shellcheck disable=SC2064
|
||||||
|
set -eu
|
||||||
|
|
||||||
# pve-nag-buster (v02) https://github.com/foundObjects/pve-nag-buster
|
# pve-nag-buster (v04) https://github.com/foundObjects/pve-nag-buster
|
||||||
# Copyright (C) 2019 /u/seaQueue (reddit.com/u/seaQueue)
|
# Copyright (C) 2019 /u/seaQueue (reddit.com/u/seaQueue)
|
||||||
#
|
#
|
||||||
# Removes Proxmox VE 5.x license nags automatically after updates
|
# Removes Proxmox VE 6.x+ license nags automatically after updates
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@ -19,72 +21,147 @@
|
|||||||
# 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)
|
# ensure a predictable environment
|
||||||
|
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
\unalias -a
|
||||||
|
|
||||||
# create the pve-no-subscription list
|
# installer main body:
|
||||||
|
_main() {
|
||||||
echo "$0: Creating PVE no-subscription repo list ..."
|
# ensure $1 exists so 'set -u' doesn't error out
|
||||||
cat <<EOF>"/etc/apt/sources.list.d/pve-no-subscription.list"
|
{ [ "$#" -eq "0" ] && set -- ""; } > /dev/null 2>&1
|
||||||
# .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
|
|
||||||
|
|
||||||
cat <<'EOF' >/etc/apt/apt.conf.d/86pve-nags
|
|
||||||
DPkg::Pre-Install-Pkgs {
|
|
||||||
"while read -r pkg; do case $pkg in *proxmox-widget-toolkit* | *pve-manager*) touch /tmp/.pve-nag-buster && exit 0; esac done < /dev/stdin";
|
|
||||||
};
|
|
||||||
|
|
||||||
DPkg::Post-Invoke {
|
|
||||||
"[ -f /tmp/.pve-nag-buster ] && /usr/share/pve-nag-buster.sh && rm -f /tmp/.pve-nag-buster; exit 0";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# fetch the post-install patch script, patches license nag and switches to pve-no-subscription repository as needed
|
|
||||||
|
|
||||||
if true ; then
|
|
||||||
wget https://raw.githubusercontent.com/foundObjects/pve-nag-buster/master/pve-nag-buster.sh \
|
|
||||||
-O "/usr/share/pve-nag-buster.sh" && \
|
|
||||||
chmod +x "/usr/share/pve-nag-buster.sh" && \
|
|
||||||
/usr/share/pve-nag-buster.sh
|
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
"--emit")
|
||||||
|
# call the emit_script() function to stdout and exit, use this to verify
|
||||||
|
# that the base64 encoded script below isn't doing anything malicious
|
||||||
|
# does not require root
|
||||||
|
emit_script
|
||||||
|
;;
|
||||||
|
"--uninstall")
|
||||||
|
# uninstall, requires root
|
||||||
|
assert_root
|
||||||
|
_uninstall
|
||||||
|
;;
|
||||||
|
"--install" | "--offline" | "")
|
||||||
|
# install dpkg hooks, requires root
|
||||||
|
assert_root
|
||||||
|
_install "$@"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# unknown flags, print usage and exit
|
||||||
|
_usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
}
|
||||||
|
|
||||||
# this is the end, example offline code below
|
_uninstall() {
|
||||||
|
set -x
|
||||||
|
[ -f "/etc/apt/apt.conf.d/86pve-nags" ] &&
|
||||||
|
rm -f "/etc/apt/apt.conf.d/86pve-nags"
|
||||||
|
[ -f "/usr/share/pve-nag-buster.sh" ] &&
|
||||||
|
rm -f "/usr/share/pve-nag-buster.sh"
|
||||||
|
|
||||||
# Example code for inclusion into host provisioning scripts offline: this is just pve-nag-buster.sh
|
echo "Script and dpkg hooks removed, please manually remove /etc/apt/sources.list.d/pve-no-subscription.list if desired"
|
||||||
# run through "xz -z -9 -c pve-nag-buster.sh | base64" to avoid needing to fetch the script from github
|
}
|
||||||
# To use this installer offline just nuke the entire if block above.
|
|
||||||
|
_install() {
|
||||||
|
# create hooks and no-subscription repo list, install hook script, run once
|
||||||
|
|
||||||
|
VERSION_CODENAME=''
|
||||||
|
ID=''
|
||||||
|
. /etc/os-release
|
||||||
|
if [ -n "$VERSION_CODENAME" ]; then
|
||||||
|
RELEASE="$VERSION_CODENAME"
|
||||||
|
else
|
||||||
|
RELEASE=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# create the pve-no-subscription list
|
||||||
|
echo "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 at $(date)
|
||||||
|
#
|
||||||
|
# If pve-nag-buster is installed again this file will be overwritten
|
||||||
|
#
|
||||||
|
|
||||||
|
deb http://download.proxmox.com/debian/pve $RELEASE pve-no-subscription
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# create dpkg pre/post install hooks for persistence
|
||||||
|
echo "Creating dpkg hooks in /etc/apt/apt.conf.d ..."
|
||||||
|
cat <<- 'EOF' > "/etc/apt/apt.conf.d/86pve-nags"
|
||||||
|
DPkg::Pre-Install-Pkgs {
|
||||||
|
"while read -r pkg; do case $pkg in *proxmox-widget-toolkit* | *pve-manager*) touch /tmp/.pve-nag-buster && exit 0; esac done < /dev/stdin";
|
||||||
|
};
|
||||||
|
|
||||||
|
DPkg::Post-Invoke {
|
||||||
|
"[ -f /tmp/.pve-nag-buster ] && { /usr/share/pve-nag-buster.sh; rm -f /tmp/.pve-nag-buster; }; exit 0";
|
||||||
|
};
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# install the hook script
|
||||||
|
temp=''
|
||||||
|
if [ "$1" = "--offline" ]; then
|
||||||
|
# packed script requested
|
||||||
|
temp="$(mktemp)" && trap "rm -f $temp" EXIT
|
||||||
|
emit_script > "$temp"
|
||||||
|
elif [ -f "pve-nag-buster.sh" ]; then
|
||||||
|
# local copy available
|
||||||
|
temp="pve-nag-buster.sh"
|
||||||
|
else
|
||||||
|
# fetch from github
|
||||||
|
echo "Fetching hook script from GitHub ..."
|
||||||
|
tempd="$(mktemp -d)" &&
|
||||||
|
trap "echo 'Cleaning up temporary files ...'; rm -f $tempd/*; rmdir $tempd" EXIT
|
||||||
|
temp="$tempd/pve-nag-buster.sh"
|
||||||
|
wget https://raw.githubusercontent.com/foundObjects/pve-nag-buster/master/pve-nag-buster.sh \
|
||||||
|
-q --show-progress -O "$temp"
|
||||||
|
fi
|
||||||
|
echo "Installing hook script as /usr/share/pve-nag-buster.sh"
|
||||||
|
install -o root -m 0550 "$temp" "/usr/share/pve-nag-buster.sh"
|
||||||
|
|
||||||
|
echo "Running patch script"
|
||||||
|
/usr/share/pve-nag-buster.sh
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# emit a stored copy of pve-nag-buster.sh offline -- this is intended to be used during
|
||||||
|
# offline provisioning where we don't have access to github or a full cloned copy of the
|
||||||
|
# project
|
||||||
|
|
||||||
|
# run 'install.sh --emit' to dump stored script to stdout
|
||||||
|
|
||||||
# Important: if you're not me you should probably decode this and read it to make sure I'm not doing
|
# Important: if you're not me you should probably decode this and read it to make sure I'm not doing
|
||||||
# something malicious like mining dogecoin or stealing your valuable cat pictures
|
# something malicious like mining dogecoin or stealing your valuable cat pictures
|
||||||
|
|
||||||
# pve-nag-buster.sh (v02) inline:
|
# pve-nag-buster.sh (v04) encoded below:
|
||||||
|
|
||||||
base64 -d <<"YEET"| unxz > "/usr/share/pve-nag-buster.sh" && \
|
emit_script() {
|
||||||
chmod +x "/usr/share/pve-nag-buster.sh" && \
|
base64 -d << 'YEET' | unxz
|
||||||
/usr/share/pve-nag-buster.sh
|
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
|
zeNfscRn+wIAAAAABFla
|
||||||
YEET
|
YEET
|
||||||
|
}
|
||||||
|
|
||||||
|
assert_root() { [ "$(id -u)" -eq '0' ] || { echo "This action requires root." && exit 1; }; }
|
||||||
|
_usage() { echo "Usage: $(basename "$0") (--emit|--offline|--uninstall)"; }
|
||||||
|
|
||||||
|
_main "$@"
|
||||||
|
23
make-release.sh
Executable file
23
make-release.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
_VERS="v04"
|
||||||
|
_BRANCH=$(git rev-parse --abbrev-ref HEAD) >/dev/null 2>&1 ||
|
||||||
|
{ echo "can't poll branch, defaulting to master" && _BRANCH="master"; }
|
||||||
|
|
||||||
|
# update versions before packing install.sh
|
||||||
|
sed -i -r \
|
||||||
|
-e "s;\(v[[:digit:]][[:digit:]].?\);\($_VERS\);" \
|
||||||
|
-e "s;(nag-buster/).*(/(pve-nag-buster|install)\.sh);\1$_BRANCH\2;" \
|
||||||
|
pve-nag-buster.sh install.sh README.md
|
||||||
|
|
||||||
|
# TODO there's probably a two liner to handle all of this in awk:
|
||||||
|
|
||||||
|
# pack install.sh
|
||||||
|
{
|
||||||
|
head -n"$(grep -n "<< 'YEET'" install.sh | cut -d: -f1)" install.sh
|
||||||
|
xz -z -9 -c pve-nag-buster.sh | base64
|
||||||
|
tail -n+"$(grep -n '^YEET$' install.sh | cut -d: -f1)" install.sh
|
||||||
|
} > foofile
|
||||||
|
cat foofile > install.sh
|
||||||
|
rm -f foofile
|
||||||
|
|
@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# pve-nag-buster.sh (v02) https://github.com/foundObjects/pve-nag-buster
|
# pve-nag-buster.sh (v04) https://github.com/foundObjects/pve-nag-buster
|
||||||
# Copyright (C) 2019 /u/seaQueue (reddit.com/u/seaQueue)
|
# Copyright (C) 2019 /u/seaQueue (reddit.com/u/seaQueue)
|
||||||
#
|
#
|
||||||
# Removes Proxmox VE 5.x license nags automatically after updates
|
# Removes Proxmox VE 6.x+ license nags automatically after updates
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@ -19,15 +19,16 @@
|
|||||||
# 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.
|
||||||
|
|
||||||
NAGTOKEN="data.status !== 'Active'"
|
NAGTOKEN="data.status.toLowerCase() !== 'active'"
|
||||||
NAGFILE="/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js"
|
NAGFILE="/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js"
|
||||||
|
SCRIPT="$(basename "$0")"
|
||||||
|
|
||||||
# disable license nag: https://johnscs.com/remove-proxmox51-subscription-notice/
|
# disable license nag: https://johnscs.com/remove-proxmox51-subscription-notice/
|
||||||
|
|
||||||
if $(grep -q "$NAGTOKEN" "$NAGFILE") ; then
|
if grep -qs "$NAGTOKEN" "$NAGFILE" > /dev/null 2>&1; then
|
||||||
echo "$0: Removing Nag ..."
|
echo "$SCRIPT: Removing Nag ..."
|
||||||
sed -i.orig "s/$NAGTOKEN/false/g" "$NAGFILE"
|
sed -i.orig "s/$NAGTOKEN/false/g" "$NAGFILE"
|
||||||
systemctl restart pveproxy.service
|
systemctl restart pveproxy.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# disable paid repo list
|
# disable paid repo list
|
||||||
@ -35,6 +36,6 @@ fi
|
|||||||
PAID_BASE="/etc/apt/sources.list.d/pve-enterprise"
|
PAID_BASE="/etc/apt/sources.list.d/pve-enterprise"
|
||||||
|
|
||||||
if [ -f "$PAID_BASE.list" ]; then
|
if [ -f "$PAID_BASE.list" ]; then
|
||||||
echo "$0: Disabling PVE paid repo list ..."
|
echo "$SCRIPT: Disabling PVE paid repo list ..."
|
||||||
mv -f "$PAID_BASE.list" "$PAID_BASE.disabled"
|
mv -f "$PAID_BASE.list" "$PAID_BASE.disabled"
|
||||||
fi
|
fi
|
||||||
|
72
src/install
72
src/install
@ -1,72 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# pve-nag-buster (__VERSION__) https://github.com/foundObjects/pve-nag-buster
|
|
||||||
# Copyright (C) 2019 /u/seaQueue (reddit.com/u/seaQueue)
|
|
||||||
#
|
|
||||||
# Removes Proxmox VE 5.x license nags automatically after updates
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# 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
|
|
||||||
|
|
||||||
cat <<'EOF' >/etc/apt/apt.conf.d/86pve-nags
|
|
||||||
DPkg::Pre-Install-Pkgs {
|
|
||||||
"while read -r pkg; do case $pkg in *proxmox-widget-toolkit* | *pve-manager*) touch /tmp/.pve-nag-buster && exit 0; esac done < /dev/stdin";
|
|
||||||
};
|
|
||||||
|
|
||||||
DPkg::Post-Invoke {
|
|
||||||
"[ -f /tmp/.pve-nag-buster ] && /usr/share/pve-nag-buster.sh && rm -f /tmp/.pve-nag-buster; exit 0";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# fetch the post-install patch script, patches license nag and switches to pve-no-subscription repository as needed
|
|
||||||
|
|
||||||
if true ; then
|
|
||||||
wget https://raw.githubusercontent.com/foundObjects/pve-nag-buster/master/pve-nag-buster.sh \
|
|
||||||
-O "/usr/share/pve-nag-buster.sh" && \
|
|
||||||
chmod +x "/usr/share/pve-nag-buster.sh" && \
|
|
||||||
/usr/share/pve-nag-buster.sh
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# this is the end, example offline code below
|
|
||||||
|
|
||||||
# Example code for inclusion into host provisioning scripts offline: this is just pve-nag-buster.sh
|
|
||||||
# run through "xz -z -9 -c pve-nag-buster.sh | base64" to avoid needing to fetch the script from github
|
|
||||||
# To use this installer offline just nuke the entire if block above.
|
|
||||||
|
|
||||||
# Important: if you're not me you should probably decode this and read it to make sure I'm not doing
|
|
||||||
# something malicious like mining dogecoin or stealing your valuable cat pictures
|
|
||||||
|
|
||||||
# pve-nag-buster.sh (__VERSION__) inline:
|
|
||||||
|
|
||||||
base64 -d <<"YEET"| unxz > "/usr/share/pve-nag-buster.sh" && \
|
|
||||||
chmod +x "/usr/share/pve-nag-buster.sh" && \
|
|
||||||
/usr/share/pve-nag-buster.sh
|
|
@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
_VERS="v02"
|
|
||||||
|
|
||||||
_OUTFILE="pve-nag-buster.sh"
|
|
||||||
|
|
||||||
sed "s/__VERSION__/$_VERS/g" src/script > $_OUTFILE
|
|
||||||
|
|
||||||
_OUTFILE="install.sh"
|
|
||||||
|
|
||||||
sed "s/__VERSION__/$_VERS/g" src/install > $_OUTFILE
|
|
||||||
xz -z -9 -c pve-nag-buster.sh | base64 >> $_OUTFILE
|
|
||||||
echo "YEET" >> $_OUTFILE
|
|
40
src/script
40
src/script
@ -1,40 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# pve-nag-buster.sh (__VERSION__) https://github.com/foundObjects/pve-nag-buster
|
|
||||||
# Copyright (C) 2019 /u/seaQueue (reddit.com/u/seaQueue)
|
|
||||||
#
|
|
||||||
# Removes Proxmox VE 5.x license nags automatically after updates
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
NAGTOKEN="data.status !== 'Active'"
|
|
||||||
NAGFILE="/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js"
|
|
||||||
|
|
||||||
# disable license nag: https://johnscs.com/remove-proxmox51-subscription-notice/
|
|
||||||
|
|
||||||
if $(grep -q "$NAGTOKEN" "$NAGFILE") ; then
|
|
||||||
echo "$0: Removing Nag ..."
|
|
||||||
sed -i.orig "s/$NAGTOKEN/false/g" "$NAGFILE"
|
|
||||||
systemctl restart pveproxy.service
|
|
||||||
fi
|
|
||||||
|
|
||||||
# disable paid repo list
|
|
||||||
|
|
||||||
PAID_BASE="/etc/apt/sources.list.d/pve-enterprise"
|
|
||||||
|
|
||||||
if [ -f "$PAID_BASE.list" ]; then
|
|
||||||
echo "$0: Disabling PVE paid repo list ..."
|
|
||||||
mv -f "$PAID_BASE.list" "$PAID_BASE.disabled"
|
|
||||||
fi
|
|
Loading…
x
Reference in New Issue
Block a user