home · contact · privacy
Fix.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 3 Apr 2025 03:09:55 +0000 (05:09 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 3 Apr 2025 03:09:55 +0000 (05:09 +0200)
testing/scripts/lib/mount_secrets

index 3b98f3d512b0f32d125ecb880e92a9e8b593ed8a..6bfc6f09129795dcf46f23342ebd9e13f9548d97 100644 (file)
@@ -6,6 +6,9 @@
 mount_secrets() {
     expect_min_n_args 1 "(device name, e.g. 'sda')" "$@"
     SECRETS_DEV=$1
+    if [ -z "${SECRETS_DEV}" ]; then
+        abort "Aborting due to empty device argument."
+    fi
     PATH_MOUNTED_SECRETS="${PATH_MEDIA}/${SECRETS_DEV}/${PATH_REL_SECRETS}"
     PATH_DEV="/dev/${SECRETS_DEV}"
     PATH_PMOUNT_ERR="$(path_tmp_timestamped 'err_mount')"
@@ -24,8 +27,8 @@ mount_secrets() {
         if [ "${RESULT}" = "0" ]; then
             break
         elif [ "${RESULT}" != "100" ]; then
-       PMOUNT_ERR="$(cat ${PATH_PMOUNT_ERR})"
-       rm "${PATH_PMOUNT_ERR}"
+        PMOUNT_ERR="$(cat ${PATH_PMOUNT_ERR})"
+        rm "${PATH_PMOUNT_ERR}"
             abort "Aborting due to pmount error: ${PMOUNT_ERR}"
         fi
     done