qmnt - If entire disk is specified, recursively mount entire disk

This commit is contained in:
Logan G 2024-09-25 15:46:43 -06:00
parent 05971b56cd
commit 877ade171b
Signed by: logan
GPG key ID: E328528C921E7A7A

View file

@ -159,7 +159,7 @@ for arg in "$@"; do
MOUNT_OPTS+=",ro" MOUNT_OPTS+=",ro"
;; ;;
*) *)
find_target "$arg" [[ -z $TARGET ]] && find_target "$arg"
;; ;;
esac esac
done done
@ -169,6 +169,14 @@ if [[ -z $TARGET ]]; then
exit 1 exit 1
fi fi
TARGET_TYPE=$(lsblk -ndo TYPE "${TARGET}")
if [[ "$TARGET_TYPE" == "disk" && -z "$(blkid -o value -s TYPE "${TARGET}")" ]]; then
lsblk --list --paths --noheadings --output NAME,TYPE "${TARGET}" | while read name type; do
[[ "$type" = "part" ]] && TARGET="$name" "$0" $@
done
exit 0
fi
MAPPED_NAME="" MAPPED_NAME=""
LABEL=$(blkid -o value -s "${LABEL_BY}" "${TARGET}") LABEL=$(blkid -o value -s "${LABEL_BY}" "${TARGET}")