summaryrefslogtreecommitdiffstats
path: root/extras/hook-scripts/set/post/S30samba-set.sh
diff options
context:
space:
mode:
authorRaghavendra Talur <rtalur@redhat.com>2015-07-14 23:24:55 +0530
committerJeff Darcy <jdarcy@redhat.com>2015-11-16 05:41:15 -0800
commitea7e34f38c97b471fee863fa749e1f0389c4b563 (patch)
tree4f2793216bb55135cffb58a9822032a2b870b477 /extras/hook-scripts/set/post/S30samba-set.sh
parent6000e1aa344e523aa161427a0b9781e052cd4d97 (diff)
extras/hooks: Fix parsing of args in S30samba-set.sh
Change-Id: I75756f44757a144b0ed229fcc0e29a273fc75886 BUG: 1242892 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/11668 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'extras/hook-scripts/set/post/S30samba-set.sh')
-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
;;