summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Talur <rtalur@redhat.com>2015-07-14 23:24:55 +0530
committerNiels de Vos <ndevos@redhat.com>2015-11-15 03:15:26 -0800
commit89db0268a75f7e7d01e5660e4cc3ffdd8487acd1 (patch)
treec639dbd90dfe492efecb020b6415d251eb9db432
parentfe120d326fd850bbea8cc5c0b3a9ba2764289e75 (diff)
extras/hooks: Fix parsing of args in S30samba-set.sh
bug: 1243041 Change-Id: I75756f44757a144b0ed229fcc0e29a273fc75886 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/11669 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
-rwxr-xr-xextras/hook-scripts/set/post/S30samba-set.sh14
1 files changed, 9 insertions, 5 deletions
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
;;