Created
March 13, 2015 12:49
-
-
Save robince/fde897e0bb46dbcdc5c4 to your computer and use it in GitHub Desktop.
isfoldernfs: script to check a destination directory is a nfs mount
This file contains 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
#!/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