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"
|
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}")
|
||||||
|
|
Loading…
Reference in a new issue