From: Christian Heller Date: Tue, 11 Mar 2025 17:39:01 +0000 (+0100) Subject: Fix borg script. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%22https:/validator.w3.org/processes?a=commitdiff_plain;h=34040550ecbd5c2debb981b48fe3f1de2acd7867;p=config Fix borg script. --- diff --git a/testing/home/desktop/.local/bin/borgplom b/testing/home/desktop/.local/bin/borgplom index 95dd580..277fbb3 100755 --- a/testing/home/desktop/.local/bin/borgplom +++ b/testing/home/desktop/.local/bin/borgplom @@ -14,6 +14,14 @@ if [ "$1" = "orgpull" ]; then fi REPO="${NAME_SERVER}:${NAME_REPO}" while true; do + if [ -z "${BORG_PASSPHRASE}" ]; then + stty -echo + printf "Borg passphrase: " + read passphrase + stty echo + printf "\n" + export BORG_PASSPHRASE="${passphrase}" + fi set +e ARCHIVES=$(borg list "${REPO}") # separate step so we may fail early on bad passphrase RESULT=$? @@ -24,12 +32,7 @@ if [ "$1" = "orgpull" ]; then echo "Aborting due to unexpected ${NAME_BORGAPP} error." exit 1 else - stty -echo - printf "Borg passphrase: " - read passphrase - stty echo - printf "\n" - export BORG_PASSPHRASE="${passphrase}" + export BORG_PASSPHRASE="" fi done ARCHIVE=$(echo "${ARCHIVES}" | grep "${NAME_ARCHIVE}" | tail -1 | cut -f1 -d' ')