dotfiles/scripts/disconnect-nfs
2017-06-17 18:35:23 +02:00

26 lines
522 B
Bash
Executable file

#!/bin/bash
#COUNT=0
#ARRAY=()
if [ -n "$(ls -A /mnt/nfs/Downloads)" ]; then
DOWNLOADS="Downloads"
echo "Unmounting $DOWNLOADS"
if sudo umount /mnt/nfs/$DOWNLOADS ; then
echo "Unmounted $DOWNLOADS"
fi
fi
if [ -n "$(ls -A /mnt/nfs/Music)" ]; then
MUSIC="Music"
echo "Unmounting $MUSIC"
if sudo umount /mnt/nfs/$MUSIC ; then
echo "Unmounted $MUSIC"
fi
fi
if [ -n "$(ls -A /mnt/nfs/Video)" ]; then
VIDEO="Video"
echo "Unmounting $VIDEO"
if sudo umount /mnt/nfs/$VIDEO ; then
echo "Unmounted $VIDEO"
fi
fi