|
@@ -314,13 +314,15 @@ esac
|
|
|
|
|
|
unmount(){
|
|
|
# Unmount if mounted
|
|
|
+# Remark: Function called unmount and not umount to avoid collision with the command
|
|
|
! mountpoint -q $mnt/proc || umount -v $mnt/proc
|
|
|
! mountpoint -q $mnt/sys || umount -v $mnt/sys
|
|
|
! mountpoint -q $mnt/dev/pts || umount -v $mnt/dev/pts
|
|
|
! mountpoint -q $mnt/dev || umount -v $mnt/dev
|
|
|
! mountpoint -q $mnt || umount -v $mnt
|
|
|
# Delete mount-point if empty and not mounted
|
|
|
-[ -d $mnt ] && [ -z "$(ls -A $mnt)" ] && ! mountpoint -q $mnt && rm -R $mnt
|
|
|
+[ -d $mnt ] && [ -z "$(ls -A $mnt)" ] && ! mountpoint -q $mnt \
|
|
|
+&& rm -R $mnt && echo "mountpoint $mnt deleted"
|
|
|
}
|
|
|
|
|
|
|