Browse Source

added umount for root partition and deletion of the mountpoint

Toastie 1 year ago
parent
commit
2ad8af21fb
1 changed files with 3 additions and 0 deletions
  1. 3 0
      bootstrap-bullseye.sh

+ 3 - 0
bootstrap-bullseye.sh

@@ -223,6 +223,9 @@ unmount(){
 ! mountpoint -q $mnt/dev/pts || umount $mnt/dev/pts
 ! mountpoint -q $mnt/dev     || umount $mnt/dev
 ! mountpoint -q $mnt/root    || umount $mnt/root
+! mountpoint -q $mnt         || umount $mnt
+# Delete mount-point if empty and not mounted
+[ -z "$(ls -A /mnt/)" ] &&  ! mountpoint -q /mnt  && rm -R $mnt
 }