From: Christian Heller Date: Fri, 4 Apr 2025 13:26:00 +0000 (+0200) Subject: Fix. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%22https:/validator.w3.org/day?a=commitdiff_plain;h=86dd080dc0c4fe1fe8dad7805d94d853706a1b60;p=config Fix. --- diff --git a/testing/home/desktop/.local/bin/borgplom b/testing/home/desktop/.local/bin/borgplom index ab5a3d1..d0af0f6 100755 --- a/testing/home/desktop/.local/bin/borgplom +++ b/testing/home/desktop/.local/bin/borgplom @@ -102,14 +102,33 @@ CMDFNC_help() { } USAGE_ARGS_info='SERVER_NAME [ARCHIVE]' -USAGE_ARGS_help='run "borg info" against repo in server of SERVER_NAME' +USAGE_ARGS_help='run "borg info" against repo in server of SERVER_NAME, optionally only against ARCHIVE; if latter not provided, instead list archives of repo' CMDFNC_info() { _check_args_n 1 "$@" - _TARGET="$(location_from_servername ${1})" + _TARGET_REPO="$(location_from_servername ${1})" if [ ! -z "$2" ]; then - _TARGET="${_TARGET}::$2}" + borg info "${_TARGET_REPO}::$2" + exit 0 fi - borg info "${_TARGET}" + while true; do + if [ -z "${BORG_PASSPHRASE}" ]; then + printf 'Passphrase:' + export BORG_PASSPHRASE="$(get_passphrase)" + echo '' + fi + set +e + _INFO=$(borg info "${_TARGET_REPO}") + _RESULT=$? + set -e + if [ "${_RESULT}" = "0" ]; then + break + elif [ "${_RESULT}" != "2" ]; then + error_exit "unexpected ${NAME_BORGAPP} error." + fi + export BORG_PASSPHRASE= + done + echo "${_INFO}" + borg list "${_TARGET_REPO}" } USAGE_DESC_keys='list known repos in ID, key filename, and alleged location'