shellcheck: export, mount. Logic syntax

This commit is contained in:
Juan David Hurtado G
2024-12-10 14:14:07 -05:00
parent 097ad8e269
commit 7bad37c250
2 changed files with 6 additions and 6 deletions

View File

@@ -209,7 +209,7 @@ if [ "${COMP_OPTION}" -gt "1" ]; then
error_exit "Error: Only one compression format can be used during export."
fi
if [ -n "${TXZ_EXPORT}" ] || [ -n "${TGZ_EXPORT}" ] && [ -n "${SAFE_EXPORT}" ]; then
if { [ -n "${TXZ_EXPORT}" ] || [ -n "${TGZ_EXPORT}" ]; } && [ -n "${SAFE_EXPORT}" ]; then
error_exit "Error: Simple archive modes with safe ZFS export can't be used together."
fi

View File

@@ -69,11 +69,11 @@ fi
# if host path doesn't exist, type is not "nullfs" or are using advanced mount type "tmpfs,linprocfs,linsysfs, fdescfs,
# procfs"
if [ "${_hostpath}" = "tmpfs" ] && [ "$_type" = "tmpfs" ] ||
[ "${_hostpath}" = "linprocfs" ] && [ "${_type}" = "linprocfs" ] ||
[ "${_hostpath}" = "linsysfs" ] && [ "${_type}" = "linsysfs" ] ||
[ "${_hostpath}" = "proc" ] && [ "${_type}" = "procfs" ] ||
[ "${_hostpath}" = "fdesc" ] && [ "${_type}" = "fdescfs" ]; then
if { [ "${_hostpath}" = "tmpfs" ] && [ "$_type" = "tmpfs" ]; } ||
{ [ "${_hostpath}" = "linprocfs" ] && [ "${_type}" = "linprocfs" ]; } ||
{ [ "${_hostpath}" = "linsysfs" ] && [ "${_type}" = "linsysfs" ]; } ||
{ [ "${_hostpath}" = "proc" ] && [ "${_type}" = "procfs" ]; } ||
{ [ "${_hostpath}" = "fdesc" ] && [ "${_type}" = "fdescfs" ]; } then
warn "Detected advanced mount type ${_hostpath}"
elif [ ! -d "${_hostpath}" ] || [ "${_type}" != "nullfs" ]; then
error_notify "Detected invalid host path or incorrect mount type in FSTAB."