Update install & config.example with some error checking
parent
e0829099ea
commit
b89c6cc586
|
|
@ -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"
|
#BORG="/usr/bin/borg"
|
||||||
|
|
||||||
SYSTEM_NAME="name-of-computer"
|
SYSTEM_NAME="name-of-computer"
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,20 @@ chown root. /usr/local/bin/borgwrapper
|
||||||
chmod 750 /usr/local/bin/borgwrapper
|
chmod 750 /usr/local/bin/borgwrapper
|
||||||
|
|
||||||
if [ ! -d /etc/borgwrapper/ ]; then
|
if [ ! -d /etc/borgwrapper/ ]; then
|
||||||
mkdir /etc/borgwrapper/config
|
mkdir /etc/borgwrapper
|
||||||
fi
|
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
|
chown root. /etc/borgwrapper/config
|
||||||
chmod 600 /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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue