Advertisement
doctorzeromd

umount-iso

Nov 23rd, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.29 KB | None | 0 0
  1. #!/bin/bash
  2. if test -d "/mnt/iso/$1";
  3.     then
  4.     sudo umount /mnt/iso/$1
  5.     sudo rm -r /mnt/iso/$1
  6.     echo "/mnt/iso/$1 unmounted"
  7.     if [ -z "$(ls -A /mnt/iso)" ]; then
  8.         sudo rm -r /mnt/iso
  9.         echo "No other ISOs mounted, so /mnt/iso was removed as well"
  10.     fi
  11.     else
  12.     echo "path not mounted"
  13. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement