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"
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})"