Skip to content

Instantly share code, notes, and snippets.

@robince
Created March 13, 2015 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robince/fde897e0bb46dbcdc5c4 to your computer and use it in GitHub Desktop.
Save robince/fde897e0bb46dbcdc5c4 to your computer and use it in GitHub Desktop.
isfoldernfs: script to check a destination directory is a nfs mount
#!/bin/bash
# check given path is an NFS mount
FSTYPE="$(df -P -T $1 | tail -n +2 | awk '{print $2}')"
# first three characters
FSTYPE=${FSTYPE:0:3}
if [ "$FSTYPE" = "nfs" ]
then
RC=0
else
RC=1
echo "isfoldernfs: $1 is not NFS"
fi
exit $RC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment