umounts 292 B

12345678910111213
  1. #!/usr/bin/env bash
  2. MOUNTED=$(shopt -s nullglob dotglob; echo /mnt/share/*)
  3. if (( ${#MOUNTED} )); then
  4. while (( ${#MOUNTED} )); do
  5. sudo umount -a -t cifs -l
  6. MOUNTED=$(shopt -s nullglob dotglob; echo /mnt/share/*)
  7. done
  8. else
  9. echo "Remote directory not mounted"
  10. fi