#!/bin/bash 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 exit fi if [ "$1" == "process" ]; then process fi # 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 fi rm $WPSET_REL echo "wpset-update is now deprecated. it's now built directly into wpset."