From 94dd2fead725363fb9ae55caccbff0391c4f9b83 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sun, 23 Mar 2025 18:56:55 +0100 Subject: [PATCH] Fix. --- testing/scripts/_setup_secrets_user.sh | 2 ++ testing/scripts/setup_secrets.sh | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/testing/scripts/_setup_secrets_user.sh b/testing/scripts/_setup_secrets_user.sh index 3c110e8..0cc1578 100644 --- a/testing/scripts/_setup_secrets_user.sh +++ b/testing/scripts/_setup_secrets_user.sh @@ -35,6 +35,7 @@ while [ ! -s "${PATH_PUBLIC_KEY}" ]; do set +e ssh-keygen -y -f "${PATH_PRIVATE_KEY}" > "${PATH_PUBLIC_KEY}" set -e + echo '' done eval $(ssh-agent) && ssh-add stty echo @@ -60,6 +61,7 @@ ls -1 "${PATH_BORGKEYS}/" | while read FILENAME; do set +e ssh-keyscan "${SERVER_NAME}" >> "${PATH_KNOWN_HOSTS}" set -e + echo '' done while true; do set +e diff --git a/testing/scripts/setup_secrets.sh b/testing/scripts/setup_secrets.sh index 399e46a..ea80501 100755 --- a/testing/scripts/setup_secrets.sh +++ b/testing/scripts/setup_secrets.sh @@ -29,6 +29,7 @@ expect_min_n_args 1 "(device name, e.g. 'sda')" "$@" SECRETS_DEV=$1 PATH_SOURCE=/media/${SECRETS_DEV}/${PATH_REL_SECRETS} PATH_DEV=/dev/${SECRETS_DEV} +PATH_PMOUNT_ERR="/tmp/err_pmount_$(date +'%s')" echo "Put secrets drive into slot for ${PATH_DEV}." while [ ! -e "${PATH_DEV}" ]; do sleep 0.1 @@ -38,13 +39,15 @@ while true; do PASSPHRASE=$(get_passphrase) echo '' set +e - echo "${PASSPHRASE}" | pmount "${PATH_DEV}" + echo "${PASSPHRASE}" | pmount "${PATH_DEV}" 2> "${PATH_PMOUNT_ERR}" RESULT=$? set -e if [ "${RESULT}" = "0" ]; then break elif [ "${RESULT}" != "100" ]; then - echo "Aborting due to pmount error." + echo "Aborting due to pmount error:" + cat "${PATH_PMOUNT_ERR}" + rm "${PATH_PMOUNT_ERR}" exit 1 fi done -- 2.30.2