2021-08-21 01:56:26 +00:00
|
|
|
#!/bin/bash
|
2021-08-27 01:48:21 +00:00
|
|
|
function process() {
|
|
|
|
# install the update
|
|
|
|
mv wpset /bin/wpset
|
|
|
|
chmod +x /bin/wpset
|
|
|
|
mv parse /etc/wpdl/parse
|
|
|
|
chmod +x /etc/wpdl/parse
|
|
|
|
cd /home/$USER/
|
|
|
|
rm -rf brendotools-wallman/
|
|
|
|
echo "done."
|
|
|
|
WPSET_LOCALVER=$(wpset -v)
|
|
|
|
if [ "$WPSET_LOCALVER" == "$WPSET_REMOTEVER" ]; then
|
|
|
|
echo "success! wpset version updated to $WPSET_LOCALVER."
|
|
|
|
else
|
|
|
|
echo "something's gone wrong. wpset version is '$WPSET_LOCALVER' when it should be $WPSET_REMOTEVER.\
|
|
|
|
try manually moving the file and running wpset -v."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
# root check
|
|
|
|
ROOT=$(whoami)
|
|
|
|
if [ "$ROOT" != "root" ]; then
|
|
|
|
sudo bash wpset-update process
|
2021-08-21 01:56:26 +00:00
|
|
|
exit
|
2021-08-27 01:48:21 +00:00
|
|
|
fi
|
2021-08-21 01:56:26 +00:00
|
|
|
|
2021-08-27 01:48:21 +00:00
|
|
|
if [ "$1" == "process" ]; then
|
|
|
|
process
|
|
|
|
fi
|
2021-08-22 07:09:36 +00:00
|
|
|
|
2021-08-27 01:48:21 +00:00
|
|
|
# contact tildegit to see if there's a new release
|
|
|
|
cd /home/$USER/
|
|
|
|
FOLDER_CHECK=$(ls | grep brendotools-wallman)
|
|
|
|
if [ "$FOLDER_CHECK" != "" ]; then
|
|
|
|
rm -rf brendotools-wallman*
|
|
|
|
fi
|
|
|
|
git clone https://tildegit.org/BrendanTCC/brendotools-wallman/
|
|
|
|
cd brendotools-wallman
|
|
|
|
source parse
|
|
|
|
parse
|
|
|
|
git checkout tags/$DOWNLOAD_VERSION
|
|
|
|
# set the version because GOOD GOD I'M A LAZY CUNT
|
|
|
|
echo wpset | sed "s/VERSION\=\"\"/VERSION\=\"$DOWNLOAD_VERSION\""
|
|
|
|
# setting USER variable
|
|
|
|
USER=$(logname)
|
|
|
|
|
|
|
|
# root check
|
|
|
|
ROOT=$(whoami)
|
|
|
|
if [ "$ROOT" != "root" ]; then
|
|
|
|
sudo bash /home/$USER/brendotools-wallman/wpset-update process
|
|
|
|
else
|
|
|
|
process
|
2021-08-21 01:56:26 +00:00
|
|
|
fi
|
2021-08-22 07:09:36 +00:00
|
|
|
rm $WPSET_REL
|
2021-08-27 01:48:21 +00:00
|
|
|
|
|
|
|
echo "wpset-update is now deprecated. it's now built directly into wpset."
|