From 298994f379bdc9ce6d75ceb1f6e15b4ba0476cb8 Mon Sep 17 00:00:00 2001 From: vandenboer Date: Fri, 19 Mar 2021 15:19:07 +0100 Subject: [PATCH 1/4] Added check_nfs.sh for checking if the shares of an NFS server are mountable. Detects shares automatically --- check_nfs.sh | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100755 check_nfs.sh diff --git a/check_nfs.sh b/check_nfs.sh new file mode 100755 index 0000000..37ecb63 --- /dev/null +++ b/check_nfs.sh @@ -0,0 +1,83 @@ +#!/bin/sh +# +# Usage: +# Requires showmound command from nfs-utils or nfs-common. +# Checks the given host for NFS shares and tries to mount them. +# If all shares are mountable or there are no shares then the exit code is 0 +# Exit code 1 means the system doesn't support NFS +# Exit code 2 means the showmount command is not found +# Exit code 3 means one share couldn't be mounted + +host='' +localdir='/tmp/nfs_test' +exit_code=0 + +usage() { +echo " +usage: $0