4 Commits
Author SHA1 Message Date
Scott B 99479f5a29 fixup for v02a release 2020-01-21 03:12:22 -08:00
Scott B 674e924eaf rewrite make-release script to drop templates 2020-01-21 01:48:09 -08:00
Scott B a2608913e5 hook script: fixed grep test issue 2020-01-12 14:54:07 -08:00
Scott B 427b23b12c more reliable hook trigger removal 2020-01-12 13:05:02 -08:00
6 changed files with 56 additions and 151 deletions

No files matched your search

+25 -24
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# pve-nag-buster (v02) https://github.com/foundObjects/pve-nag-buster
# pve-nag-buster (v02a) 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
@@ -41,14 +41,14 @@ DPkg::Pre-Install-Pkgs {
};
DPkg::Post-Invoke {
"[ -f /tmp/.pve-nag-buster ] && /usr/share/pve-nag-buster.sh && rm -f /tmp/.pve-nag-buster; exit 0";
"[ -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 \
wget https://raw.githubusercontent.com/foundObjects/pve-nag-buster/v02-tracking/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
@@ -65,26 +65,27 @@ fi
# 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 (v02) inline:
# pve-nag-buster.sh (v02a) 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
/Td6WFoAAATm1rRGAgAhARwAAAAQz1jM4AXCA29dABGIQkY99Bhqpmev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XaRGtSMWeNYF3HM0S7BMSs5JdK9smn771X
X61EpggTzccoPWc5AdrAAsBCrh2eKDABd9mY+8IAsStKVcH1KIkF56Nmt0WdR9XiNn/JmmkhAy+m
0DLIrdyLcgrIirfPgSIPkVX8FC6tSu7KcSzikxuWt7SmQO9es6Q/wVmVQ4rQL2LHGLPqSHBPs4HE
msa/VSTNw2Efqk5Ofdble0Yi2ECr1YAyVQshkg859YgMg/QJ5qwjBhahG5oU4Db6lWHbQkrWLH+T
CIpfCvwJBQQnyyb0bAPgEJtbDVyjoaEkC9pTzwPvDkiJA+0cFEydxEOfMqvG3HMCcKIPN+EMh0tW
Vm9ABSQn4A9kAAAAxDleg/tFU5sAAZYH0gsAAGBjQjqxxGf7AgAAAAAEWVo=
YEET
chmod +x "/usr/share/pve-nag-buster.sh"
/usr/share/pve-nag-buster.sh
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh
_VERS="v02a"
_BRANCH=$(git branch --show-current) ||
{ echo "can't poll branch, defaulting to master" && _BRANCH="master"; }
# update versions before packing install.sh
sed -i \
-e "s;(v[[:digit:]][[:digit:]]);($_VERS);" \
-e "s;nag-buster/.*/;nag-buster/$_BRANCH/;" \
pve-nag-buster.sh install.sh README.md
#sed -i -e "s/([v[[:digit:]][[:digit:]])/($_VERS)/" pve-nag-buster.sh install.sh
#sed -i -e "s;nag-buster/.*/;nag-buster/$_BRANCH/;" install.sh README.md
# I have no idea what I'm doing 🐶
#awk 'FNR==NR{s=(!s)?$0:s RS $0;next} /__BASE64__/{sub(/__BASE64__/, s)} 1' \
# <(xz -z -9 -c pve-nag-buster.sh | base64) src/install > install.sh
# 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
+2 -2
View File
@@ -1,6 +1,6 @@
#!/bin/bash
#
# pve-nag-buster.sh (v02) https://github.com/foundObjects/pve-nag-buster
# pve-nag-buster.sh (v02a) 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
@@ -24,7 +24,7 @@ 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
if grep -qs "$NAGTOKEN" "$NAGFILE" > /dev/null 2>&1; then
echo "$0: Removing Nag ..."
sed -i.orig "s/$NAGTOKEN/false/g" "$NAGFILE"
systemctl restart pveproxy.service
-72
View File
@@ -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
-13
View File
@@ -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
View File
@@ -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