qmnt - If entire disk is specified, recursively mount entire disk
This commit is contained in:
parent
05971b56cd
commit
877ade171b
1 changed files with 9 additions and 1 deletions
10
tools/qmnt
10
tools/qmnt
|
@ -159,7 +159,7 @@ for arg in "$@"; do
|
|||
MOUNT_OPTS+=",ro"
|
||||
;;
|
||||
*)
|
||||
find_target "$arg"
|
||||
[[ -z $TARGET ]] && find_target "$arg"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
@ -169,6 +169,14 @@ if [[ -z $TARGET ]]; then
|
|||
exit 1
|
||||
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=""
|
||||
|
||||
LABEL=$(blkid -o value -s "${LABEL_BY}" "${TARGET}")
|
||||
|
|
Loading…
Reference in a new issue