Source secrets in hook, not in script. Makes the script usable in other contexts

This commit is contained in:
flyingscorpio@pinebookpro 2020-10-31 09:47:39 +01:00
parent 9c5e6cfa5f
commit 43f6f5e80e
2 changed files with 1 additions and 4 deletions

View file

@ -39,9 +39,6 @@ fi
[ "$1" = '-f' ] || stat_cache_file
# shellcheck source=./secrets
source /home/*/SetupCockpit/secrets
touch "$cache_file"
# Setting this so the repo does not need to be given on the command line:
BORG_REPO=ssh://"$SSH_REPO":22/~/"$(hostname)".borg

View file

@ -8,5 +8,5 @@ Target = *
[Action]
Description = Borg backup
When = PreTransaction
Exec = /bin/bash -c "/home/*/SetupCockpit/borg_backup.sh"
Exec = /bin/bash -c "source /home/*/SetupCockpit/secrets && /home/*/SetupCockpit/borg_backup.sh"
Depends = borg