Update install & config.example with some error checking

dev
Bryan 2020-11-01 09:50:34 -06:00
parent e0829099ea
commit b89c6cc586
2 changed files with 27 additions and 3 deletions

View File

@ -1,3 +1,16 @@
######################################################################
## SET THE FOLLOWING TO "TRUE" WHEN YOU HAVE CONFIGURED THIS FILE ####
######################################################################
CONFIGURED="FALSE"
if [ "${CONFIGURED}" != "TRUE" ]; then
echo "Config file has not been set up."
exit 1
fi
# Beginning of configuration:
#############################
#BORG="/usr/bin/borg"
SYSTEM_NAME="name-of-computer"

15
src/install Normal file → Executable file
View File

@ -5,9 +5,20 @@ chown root. /usr/local/bin/borgwrapper
chmod 750 /usr/local/bin/borgwrapper
if [ ! -d /etc/borgwrapper/ ]; then
mkdir /etc/borgwrapper/config
mkdir /etc/borgwrapper
fi
cp -i config /etc/borgwrapper/config
if [ ! -e ./config ]; then
echo "Please rename \"config.example\" to \"config\""
echo "And make sure to update with your settings before running \"install\" again!"
exit 1
fi
cp -i ./config /etc/borgwrapper/config
chown root. /etc/borgwrapper/config
chmod 600 /etc/borgwrapper/config
echo
echo "Please edit \"/etc/borgwrapper/config\" to make changes to configuration."
echo "Read \"README.md\" for more information."
echo