From 087703fae449b725ebd82bc3cd65763a016fb098 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Wed, 11 Oct 2017 13:29:13 +0530 Subject: extras/hooks: Fix errors reported via shellcheck utility Change-Id: I217c6b2a39955f1709bb3452b00d33c2dcb60faa BUG: 1500649 Signed-off-by: Anoop C S --- extras/hook-scripts/set/post/S30samba-set.sh | 12 ++++++------ .../set/post/S32gluster_enable_shared_storage.sh | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'extras/hook-scripts/set') diff --git a/extras/hook-scripts/set/post/S30samba-set.sh b/extras/hook-scripts/set/post/S30samba-set.sh index 97d067fc33f..c21cfb57205 100755 --- a/extras/hook-scripts/set/post/S30samba-set.sh +++ b/extras/hook-scripts/set/post/S30samba-set.sh @@ -28,7 +28,7 @@ USERSMB_SET="" USERCIFS_SET="" function parse_args () { - ARGS=$(getopt -l $OPTSPEC --name $PROGNAME -o "o:" -- $@) + ARGS=$(getopt -l $OPTSPEC --name $PROGNAME -o "o:" -- "$@") eval set -- "$ARGS" while true; do @@ -123,23 +123,23 @@ function get_smb () { usersmbvalue=$(grep user.smb $GLUSTERD_WORKDIR/vols/"$volname"/info |\ cut -d"=" -f2) - if [[ $usercifsvalue = "disable" || $usersmbvalue = "disable" ]]; then + if [ $usercifsvalue = "disable" ] || [ $usersmbvalue = "disable" ]; then uservalue="disable" fi echo "$uservalue" } -parse_args $@ -if [ "0" = $(is_volume_started "$VOL") ]; then +parse_args "$@" +if [ "0" = "$(is_volume_started "$VOL")" ]; then exit 0 fi -if [[ "$USERCIFS_SET" = "YES" || "$USERSMB_SET" = "YES" ]]; then +if [ "$USERCIFS_SET" = "YES" ] || [ "$USERSMB_SET" = "YES" ]; then #Find smb.conf, smbd pid directory and smbd logfile path find_config_info - if [ $(get_smb "$VOL") = "disable" ]; then + if [ "$(get_smb "$VOL")" = "disable" ]; then del_samba_share $VOL sighup_samba else diff --git a/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh b/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh index c0aa73548fd..885ed03ad5b 100755 --- a/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh +++ b/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh @@ -104,7 +104,7 @@ function check_volume_status() echo $status } -mount_cmd="mount -t glusterfs "$local_node_hostname":/gluster_shared_storage \ +mount_cmd="mount -t glusterfs $local_node_hostname:/gluster_shared_storage \ /var/run/gluster/shared_storage" if [ "$option" == "enable" ]; then @@ -117,7 +117,7 @@ if [ "$option" == "enable" ]; then if [ "$retry" == 3 ]; then break; fi - status = check_volume_status; + status=$(check_volume_status) done # Mount the volume on all the nodes umount /var/run/gluster/shared_storage -- cgit