add setup script.

will i account for remote git tags? yes, eventually.
This commit is contained in:
Brendan Webb 2021-08-21 21:03:30 +10:00
parent daf262787f
commit 95b3b9dfe8
1 changed files with 52 additions and 0 deletions

52
wpset-setup Normal file
View File

@ -0,0 +1,52 @@
#!/bin/bash
# version
VERSION="1.0"
# root check
ROOT=$(whoami)
if [ "$ROOT" != "root" ]; then
echo "sorry, root privileges are required to continue."
exit
fi
# setting USER variable
USER=$(logname)
# location where config file will reside.
# DO NOT CHANGE AS THIS IS HARD-CODED INTO
# ALL THE SCRIPTS AND ***BY GOD*** WILL IT BE A NIGHTMARE TO CHANGE.
CONFIG="/home/$USER/.config/wpdl.conf"
# the actual fuckin question asking... thing
echo "wpset setup script v$VERSION"
sleep 2
clear
echo "thanks for choosing wpdl - brendan's stupidly over-engineered wallpaper manager."
echo "this script will install wpset, as well as help you set up your config file."
echo ""
echo "what folder on the SMB share are your wallpapers stored?"
echo -n "i.e: brendo/Wallpapers: "
read SMBFOLDER
echo -n "what ssh user will we use to establish a tunnel? "
read SSH_USER
echo -n "what host will we connect to over ssh? "
read SSH_HOST
echo -n "what do you want me to call your SMB host? "
read HOST_DISP
echo "that's all i need! creating config file at $CONFIG..."
# let's write the config file.
echo "#!/bin/bash" >> $CONFIG
echo "SMBFOLDER=\"$SMBFOLDER\"" >> $CONFIG
echo "HOST=\"localhost\"" >> $CONFIG
echo "SSH_USER=\"$SSH_USER\"" >> $CONFIG
echo "SSH_HOST=\"$SSH_HOST\"" >> $CONFIG
echo "HOST_DISP=\"$HOST_DISP\"" >> $CONFIG
echo "WALL_LOC=\"/home/$USER/wallpaper\"" >> $CONFIG
echo "LASTWP_LOC=\"\$WALL_LOC/.lastwp\"" >> $CONFIG
echo "LAST=\$(cat /home/$USER/wallpaper/.lastwp)" >> $CONFIG
chown $USER:$USER $CONFIG
echo "done! now let's chuck wpset in /bin/..."
mv wpset /bin/wpset
echo "done! goodbye."