qmnt - Added checks to see if partition is already mounted, or mountpoint occupied
This commit is contained in:
parent
d4736bc591
commit
44cad425a4
1 changed files with 6 additions and 3 deletions
|
@ -189,9 +189,12 @@ fi
|
||||||
|
|
||||||
|
|
||||||
if [[ -z $DRY_RUN ]]; then
|
if [[ -z $DRY_RUN ]]; then
|
||||||
if ! mount -o "${MOUNT_OPTS}" --source "${TARGET}" --target "${MOUNT_FOLDER}/${LABEL}"; then
|
if \
|
||||||
echo -e "\e[1;31mFailed to mount \"${TARGET}\"!""\e[0m" 1>&2
|
mountpoint "${MOUNT_FOLDER}/${LABEL}" 2>&1 &>/dev/null || \
|
||||||
exit 1
|
findmnt -n -o SOURCE "${TARGET}" 2>&1 &>/dev/null || \
|
||||||
|
! mount -o "${MOUNT_OPTS}" --source "${TARGET}" --target "${MOUNT_FOLDER}/${LABEL}"; then
|
||||||
|
echo -e "\e[1;31mFailed to mount \"${TARGET}\"!""\e[0m" 1>&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|
Loading…
Reference in a new issue