home · contact · privacy
Fix. master
authorChristian Heller <c.heller@plomlompom.de>
Mon, 7 Apr 2025 20:02:42 +0000 (22:02 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 7 Apr 2025 20:02:42 +0000 (22:02 +0200)
testing/home/desktop/.local/bin/borgplom
testing/scripts/lib/mount_secrets

index 7e256583c9d5146289e146f0ad9e24091ef3168e..75b3f82530726f382077c601134e2e36ffaa1fb4 100755 (executable)
@@ -30,7 +30,7 @@ USAGE_INDICES='backup_keys claim help info init keys orgpull orgpush'
 
 _run_borg_with_passphrase() {
     _FIRST_RUN=1
-    _PREPARE='
+    _ON_LOOP_START='
         if [ -z "${BORG_PASSPHRASE}" ]; then
             printf "Passphrase:"
             export BORG_PASSPHRASE="$(get_passphrase)"
@@ -40,7 +40,7 @@ _run_borg_with_passphrase() {
     _TO_TEST='borg '"$@"
     _ON_FAIL='echo "unexpected borg error, code ${_RESULT}."'
     _ON_LOOP_END='export BORG_PASSPHRASE='
-    retry_until 52 "${_PREPARE}" "${_TO_TEST}" "${_ON_FAIL}" "${_ON_LOOP_END}"
+    retry_until 52 "${_ON_LOOP_START}" "${_TO_TEST}" "${_ON_FAIL}" "${_ON_LOOP_END}"
 }
 
 _id_from_file() { head -1 "$1" | cut -d' ' -f2; }
index d262c527e545d191ed3052e50688695361269850..b49c5597a5cead9441d7d02933eeea4fb8346af8 100644 (file)
@@ -17,10 +17,10 @@ mount_secrets() {
     while [ ! -e "${PATH_DEV}" ]; do
         sleep 0.1
     done
-    _PREPARE='printf "Passphrase: "; PASSPHRASE=$(get_passphrase); echo ""'
+    _ON_LOOP_START='printf "Passphrase: "; PASSPHRASE=$(get_passphrase); echo ""'
     _TO_TEST='echo "${PASSPHRASE}" | pmount "${PATH_DEV}" 2>&1'
     _ON_FAIL='echo "Aborting due to pmount error:'
-    retry_until 100 "${_PREPARE}" "${_TO_TEST}" "${_ON_FAIL}"
+    retry_until 100 "${_ON_LOOP_START}" "${_TO_TEST}" "${_ON_FAIL}"
     echo "${_OUTPUT}"
 }