From 8c21aac77fe9e7eaa0cd99099330b3be081c8101 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 22 Feb 2017 14:38:45 +1100 Subject: [PATCH] ctdb-doc: Make example NFS Ganesha call-out almost pass shellcheck This call-out is referred to in the wiki as an example, so make it as clean as possible. All the changes here are trivial. There is still one failure, which is slightly non-trivial, so it can be fixed in a separate commit. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/doc/examples/nfs-ganesha-callout | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ctdb/doc/examples/nfs-ganesha-callout b/ctdb/doc/examples/nfs-ganesha-callout index c03b99a800d..ac966991a17 100755 --- a/ctdb/doc/examples/nfs-ganesha-callout +++ b/ctdb/doc/examples/nfs-ganesha-callout @@ -51,7 +51,7 @@ nfs_service="${CTDB_NFS_SERVICE:-nfs-ganesha}" ganesha_rec_subdir=${CTDB_GANESHA_REC_SUBDIR:-.ganesha} procfs=${PROCFS_PATH:-/proc} -case $state_fs in +case "$state_fs" in gpfs) GANRECDIR="/var/lib/nfs/ganesha" ;; @@ -60,7 +60,7 @@ glusterfs) echo "CTDB_NFS_STATE_MNT not defined for GlusterFS" exit 1 fi - host=`hostname` + host=$(hostname) NODESTATEDIR="$state_dir/nfs-ganesha/$host" GANSTATEDIR="$state_dir/nfs-ganesha/.noderefs" NODESTATELN="$GANSTATEDIR/$host" @@ -72,7 +72,7 @@ esac usage () { - _c=$(basename $0) + _c=$(basename "$0") cat </dev/null 2>&1 then @@ -266,7 +266,7 @@ nfs_takeip () { case $state_fs in glusterfs) - check_ln ${NODESTATEDIR} ${GANSTATEDIR}/${2} + check_ln "$NODESTATEDIR" "${GANSTATEDIR}/${2}" ;; esac if [ -x "/usr/bin/grace_period" ]; then @@ -304,7 +304,7 @@ nfs_startup () nfs_monitor_list_shares () { - grep Path $nfs_exports_file | + grep Path "$nfs_exports_file" | cut -f2 -d\" | sort -u } -- 2.11.4.GIT