diff --git a/bare.sh b/bare.sh index 0e61cf4..e0ae154 100755 --- a/bare.sh +++ b/bare.sh @@ -389,15 +389,17 @@ function do_mount() { } function do_umount() { - if [[ $USEUSMB -eq 1 ]]; then - log "Unmounting usmb volume '$USMBNAME'" - usmb -u $USMBNAME - elif [[ $USENFS -eq 1 ]]; then - log "Unmounting nfs volume '$NFSPATH' from $DATAPATH" - umount $DATAPATH - elif [[ $USELOCALMOUNT -eq 1 ]]; then - log "Unmounting dir $DATAPATH" - umount $DATAPATH + if is_mounted $DATAPATH; then + if [[ $USEUSMB -eq 1 ]]; then + log "Unmounting usmb volume '$USMBNAME'" + usmb -u $USMBNAME + elif [[ $USENFS -eq 1 ]]; then + log "Unmounting nfs volume '$NFSPATH' from $DATAPATH" + umount $DATAPATH + elif [[ $USELOCALMOUNT -eq 1 ]]; then + log "Unmounting dir $DATAPATH" + umount $DATAPATH + fi fi }