From: Christian Heller Date: Thu, 3 Apr 2025 01:01:50 +0000 (+0200) Subject: Fix. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/%7B%7Bdb.prefix%7D%7D/%7B%7Btodo.comment%7D%7D?a=commitdiff_plain;h=2319297287fefcce312ceefb146c0cdd3e9be09d;p=config Fix. --- diff --git a/testing/home/desktop/.local/bin/borgplom b/testing/home/desktop/.local/bin/borgplom index 003090f..340cbd3 100755 --- a/testing/home/desktop/.local/bin/borgplom +++ b/testing/home/desktop/.local/bin/borgplom @@ -66,13 +66,7 @@ _check_args_beyond() { fi } -_id_from_file() { - _ID=$(head -1 "$1" | cut -d'/' -f2) - if [ ! -z "$(echo ${_ID} | sed 's/[a-f0-9]//g')" ]; then - error_exit "inability to parse valid repo ID from alleged key file at $1" - fi - printf "${_ID}" -} +_id_from_file() { head -1 "$1" | cut -d'/' -f2 } HELP_ARGS_backup_keys=' PATH' HELP_DESC_backup_keys="copy known keys to PATH/, with their repos' server names as filenames" @@ -117,6 +111,9 @@ CMDFNC_claim() { fi _ensure_no_overwrite_at "${_PATH_TARGET_KEY}" _REPO_ID="$(_id_from_file ${_PATH_SOURCE})" + if [ ! -z "$(echo ${_REPO_ID} | sed 's/[a-f0-9]//g')" ]; then + error_exit "inability to parse valid repo ID from alleged key file at $1" + fi _PATH_TARGET_LOCATION="$(path_repo_location ${_REPO_ID})" _ensure_no_overwrite_at "${_PATH_TARGET_LOCATION}" mkdir -p "${PATH_BORG_CONF_KEYS}" "$(dirname ${_PATH_TARGET_LOCATION})"