From 89db0268a75f7e7d01e5660e4cc3ffdd8487acd1 Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Tue, 14 Jul 2015 23:24:55 +0530 Subject: extras/hooks: Fix parsing of args in S30samba-set.sh bug: 1243041 Change-Id: I75756f44757a144b0ed229fcc0e29a273fc75886 Signed-off-by: Raghavendra Talur Reviewed-on: http://review.gluster.org/11669 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Niels de Vos --- extras/hook-scripts/set/post/S30samba-set.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'extras') diff --git a/extras/hook-scripts/set/post/S30samba-set.sh b/extras/hook-scripts/set/post/S30samba-set.sh index b8c5acf4cde..e359059992b 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 -o "o" -name $PROGNAME $@) + ARGS=$(getopt -l $OPTSPEC --name $PROGNAME -o "o:" -- $@) eval set -- "$ARGS" while true; do @@ -41,10 +41,13 @@ function parse_args () { shift GLUSTERD_WORKDIR=$1 ;; - *) + --) + shift + break + ;; + -o) shift - for pair in $@; do - read key value < <(echo "$pair" | tr "=" " ") + read key value < <(echo "$1" | tr "=" " ") case "$key" in "user.cifs") USERCIFS_SET="YES" @@ -55,7 +58,8 @@ function parse_args () { *) ;; esac - done + ;; + *) shift break ;; -- cgit