From a49901eb5b5f8893064ff143d711d7f54401a12f Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Sat, 2 May 2020 12:39:00 +0200 Subject: [PATCH] Adapted base path loading function --- scripts/data/data-backup.sh | 2 +- scripts/data/export-to-system.sh | 2 +- scripts/data/import-from-system.sh | 2 +- scripts/encryption/lock.sh | 2 +- scripts/encryption/unlock.sh | 2 +- scripts/repositories/pull.sh | 2 +- scripts/repositories/push.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/data/data-backup.sh b/scripts/data/data-backup.sh index 4bbe5bc..eb46900 100644 --- a/scripts/data/data-backup.sh +++ b/scripts/data/data-backup.sh @@ -1,6 +1,6 @@ #!/bin/bash # Executes all scripts which are necessary to backup data # @author Kevin Veen-Birkenbach [aka. Frantz] -source "$(dirname "$(readlink -f "${0}")")/base.sh" || echo "Loading base.sh failed." && exit 1 +source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) bash "$SCRIPT_PATH/import-data-from-system.sh" bash "$SCRIPT_PATH/push-local-repositories.sh" diff --git a/scripts/data/export-to-system.sh b/scripts/data/export-to-system.sh index caf3b45..cb67c4c 100644 --- a/scripts/data/export-to-system.sh +++ b/scripts/data/export-to-system.sh @@ -2,5 +2,5 @@ # Executes the import script in reverse mode # @author Kevin Veen-Birkenbach [aka. Frantz] # shellcheck source=/dev/null # Deactivate SC1090 -source "$(dirname "$(readlink -f "${0}")")/base.sh" || echo "Loading base.sh failed." && exit 1 +source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) bash "$SCRIPT_PATH/import-data-from-system.sh" reverse diff --git a/scripts/data/import-from-system.sh b/scripts/data/import-from-system.sh index 8ea0900..3136177 100644 --- a/scripts/data/import-from-system.sh +++ b/scripts/data/import-from-system.sh @@ -6,7 +6,7 @@ # # shellcheck source=/dev/null # Deactivate SC1090 # shellcheck disable=SC2143 # Comparing with -z allowed -source "$(dirname "$(readlink -f "${0}")")/base.sh" || echo "Loading base.sh failed." && exit 1 +source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) if [ -z "$(mount | grep "$DECRYPTED_PATH")" ] then echo "The decrypted folder $DECRYPTED_PATH is locked. You need to unlock it!" diff --git a/scripts/encryption/lock.sh b/scripts/encryption/lock.sh index 7718d8a..220f3ad 100644 --- a/scripts/encryption/lock.sh +++ b/scripts/encryption/lock.sh @@ -4,6 +4,6 @@ # @author Kevin Veen-Birkenbach [aka. Frantz] # # shellcheck source=/dev/null # Deactivate SC1090 -source "$(dirname "$(readlink -f "${0}")")/base.sh" || echo "Loading base.sh failed." && exit 1 +source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) echo "Locking directory $DECRYPTED_PATH..." fusermount -u "$DECRYPTED_PATH" && echo "Data is now encrypted." && echo "Removing directory $DECRYPTED_PATH..." && rmdir "$DECRYPTED_PATH" diff --git a/scripts/encryption/unlock.sh b/scripts/encryption/unlock.sh index 3412c79..673fad7 100644 --- a/scripts/encryption/unlock.sh +++ b/scripts/encryption/unlock.sh @@ -4,7 +4,7 @@ # @author Kevin Veen-Birkenbach [aka. Frantz] # # shellcheck source=/dev/null # Deactivate SC1090 -source "$(dirname "$(readlink -f "${0}")")/base.sh" || echo "Loading base.sh failed." && exit 1 +source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) echo "Unlocking directory $DECRYPTED_PATH..." if [ ! -d "$DECRYPTED_PATH" ] then diff --git a/scripts/repositories/pull.sh b/scripts/repositories/pull.sh index cd86138..ebff298 100644 --- a/scripts/repositories/pull.sh +++ b/scripts/repositories/pull.sh @@ -2,5 +2,5 @@ # # Pushs all repositories # @author Kevin Veen-Birkenbach [aka. Frantz] -source "$(dirname "$(readlink -f "${0}")")/base.sh" || echo "Loading base.sh failed." && exit 1 +source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) bash "$SCRIPT_PATH/push-local-repositories.sh" push diff --git a/scripts/repositories/push.sh b/scripts/repositories/push.sh index 97a5a7c..6885782 100644 --- a/scripts/repositories/push.sh +++ b/scripts/repositories/push.sh @@ -3,7 +3,7 @@ # Pushs all repositories # @param $1 git command which should be executed instead of default pull # @author Kevin Veen-Birkenbach [aka. Frantz] -source "$(dirname "$(readlink -f "${0}")")/base.sh" || echo "Loading base.sh failed." && exit 1 +source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) if [ $# -eq 1 ] then git_command=$1