2020-01-12 21:16:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-01-13 02:17:48 +00:00
|
|
|
_VERS="v03"
|
2020-01-21 11:58:55 +00:00
|
|
|
_BRANCH=$(git branch --show-current) >/dev/null 2>&1 ||
|
2020-01-12 21:16:41 +00:00
|
|
|
{ echo "can't poll branch, defaulting to master" && _BRANCH="master"; }
|
|
|
|
|
|
|
|
# update versions before packing install.sh
|
2020-01-21 11:58:55 +00:00
|
|
|
sed -i -r \
|
|
|
|
-e "s;\(v[[:digit:]][[:digit:]].?\);\($_VERS\);" \
|
|
|
|
-e "s;(nag-buster/).*(/(pve-nag-buster|install)\.sh);\1$_BRANCH\2;" \
|
2020-01-12 21:16:41 +00:00
|
|
|
pve-nag-buster.sh install.sh README.md
|
|
|
|
|
2020-01-21 11:58:55 +00:00
|
|
|
# TODO there's probably a two liner to handle all of this in awk:
|
2020-01-12 21:16:41 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|