From: Christian Heller <c.heller@plomlompom.de> Date: Wed, 2 Apr 2025 11:45:58 +0000 (+0200) Subject: Fix. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/static/%7B%7Bprefix%7D%7D?a=commitdiff_plain;h=50f8b9f93f97fef8251d64b400d49ee7314b8e4d;p=config Fix. --- diff --git a/testing/home/desktop/.local/bin/borgplom b/testing/home/desktop/.local/bin/borgplom index e18ba76..f94d64b 100755 --- a/testing/home/desktop/.local/bin/borgplom +++ b/testing/home/desktop/.local/bin/borgplom @@ -48,8 +48,17 @@ _path_repo_location() { cmd_keys() { _PATH_CONF_KEYS="${PATH_BORG_CONF}/keys" - echo "Known keys (from ${PATH_BORG_CONF}):" - ls -1 "${_PATH_CONF_KEYS}" | while read _FILENAME; do + echo "Known keys as per ${PATH_BORG_CONF}:" + if [ ! -d "${_PATH_CONF_KEYS}" ]; then + echo "(none, since no ${_PATH_CONF_KEYS})" + exit 0 + fi + _KEYFILES="$(ls -1 ${_PATH_CONF_KEYS})" + if [ -z "${_KEYFILES}" ]; then + echo "(none, directory empty)" + exit 0 + fi + echo "${_KEYFILES}" | while read _FILENAME; do _KEY_ID=$(head -1 "${_PATH_CONF_KEYS}/${_FILENAME}" | cut -d' ' -f2) _LOCATION=? _PATH_LOC="$(cat $(_path_repo_location ${_KEY_ID}))"