Fixes #2508: Change into backup directory

This fix ensures that the backup-script will change into the backup directory before running.

Users backup via root user will no longer get a warning, that the script couldn't change into '/root'
This commit is contained in:
MrGeneration 2019-08-07 12:37:45 +02:00 committed by Thorsten Eckel
parent 54d590491e
commit cc1268a8b6

View file

@ -7,6 +7,9 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:
BACKUP_SCRIPT_PATH="$(dirname $(realpath $0))" BACKUP_SCRIPT_PATH="$(dirname $(realpath $0))"
if [ -f "${BACKUP_SCRIPT_PATH}/config" ]; then if [ -f "${BACKUP_SCRIPT_PATH}/config" ]; then
# Ensure we're inside of our Backup-Script folder (see issue 2508)
cd "${BACKUP_SCRIPT_PATH}"
# import config # import config
. ${BACKUP_SCRIPT_PATH}/config . ${BACKUP_SCRIPT_PATH}/config
else else