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