From 25929a4adaa8677ea0e693da0697b501e8c164c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Norman=20Hauk=C3=A5s?= Date: Sun, 25 Feb 2024 07:28:55 +0100 Subject: [PATCH] simplify restic script --- scripts/restic.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/restic.sh b/scripts/restic.sh index 424e425..e749f61 100755 --- a/scripts/restic.sh +++ b/scripts/restic.sh @@ -3,10 +3,10 @@ # Source: https://stackoverflow.com/a/4774063 PROJECT_ROOT="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/.." -VAULT=$(ansible-vault decrypt "$PROJECT_ROOT/group_vars/all/vault.yml" --output=-) -REPO=$(echo "$VAULT" | grep restic_url | awk '{print $2}') -REPO_PW=$(echo "$VAULT" | grep restic_pw | awk '{print $2}') - # Helper script for calling Restic using correct repo and password. -RESTIC_REPOSITORY=$REPO RESTIC_PASSWORD=$REPO_PW "$PROJECT_ROOT/vendor/restic/restic" "$@" +VAULT=$(ansible-vault decrypt "$PROJECT_ROOT/group_vars/all/vault.yml" --output=-) +export RESTIC_REPOSITORY=$(echo "$VAULT" | grep restic_url | awk '{print $2}') +export RESTIC_PASSWORD=$(echo "$VAULT" | grep restic_pw | awk '{print $2}') + +restic "$@"