From 35aacb25892600cedfb204d5e03c35beaea923a9 Mon Sep 17 00:00:00 2001 From: Nicolas CARPi Date: Wed, 21 Feb 2024 11:08:15 +0100 Subject: [PATCH] Prevent issue with unset `BORG_REMOTE_PATH` env. Fix #36. --- CHANGELOG.md | 4 ++++ elabctl.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb17919..fd8d417 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for elabctl +## Version 3.6.2 + +* Prevent issue with unset `BORG_REMOTE_PATH` env. Fix #36. + ## Version 3.6.1 * Add `--default-character-set=utf8mb4` to `elabctl mysql` command diff --git a/elabctl.sh b/elabctl.sh index 23a5e1c..69fc14f 100755 --- a/elabctl.sh +++ b/elabctl.sh @@ -3,7 +3,7 @@ # https://github.com/elabftw/elabctl/ # © 2022 Nicolas CARPi @ Deltablot # License: GPLv3 -declare -r ELABCTL_VERSION='3.6.1' +declare -r ELABCTL_VERSION='3.6.2' # default backup dir declare BACKUP_DIR='/var/backups/elabftw' @@ -55,7 +55,7 @@ function borg-backup # add these into env so it is picked up by borg export BORG_REPO="${BORG_REPO}" export BORG_PASSPHRASE="${BORG_PASSPHRASE}" - if [ -n "$BORG_REMOTE_PATH" ]; then + if [[ -v BORG_REMOTE_PATH ]]; then export BORG_REMOTE_PATH="${BORG_REMOTE_PATH}" fi # we add to the borg the uploaded files (web directory) and also the backup dir containing dumps of MySQL