Created
May 28, 2019 14:30
-
-
Save wgroenewold/437f50b3c6711ec6661d572549396e8f to your computer and use it in GitHub Desktop.
Check if NFS shares are still mounted, if not remount (needed for b0rked M$ NFS server)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
mounts=(/usr/share/mounts/folder1, /usr/share/mounts/folder2) | |
shares=(10.0.0.2:/folder1 10.0.0.2:/folder2) | |
for i in "${!shares[@]}"; | |
do | |
if cat /proc/mounts | grep "${shares[$i]}" ; then | |
continue; | |
else | |
umount -f "${mounts[$i]}" | |
mount -t nfs "${shares[$i]}" | |
fi; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment