Skip to content

Instantly share code, notes, and snippets.

@wgroenewold
Created May 28, 2019 14:30
Show Gist options
  • Save wgroenewold/437f50b3c6711ec6661d572549396e8f to your computer and use it in GitHub Desktop.
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)
#!/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