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,7 +189,10 @@ fi
|
|||
|
||||
|
||||
if [[ -z $DRY_RUN ]]; then
|
||||
if ! mount -o "${MOUNT_OPTS}" --source "${TARGET}" --target "${MOUNT_FOLDER}/${LABEL}"; then
|
||||
if \
|
||||
mountpoint "${MOUNT_FOLDER}/${LABEL}" 2>&1 &>/dev/null || \
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue