summaryrefslogtreecommitdiffstats
path: root/extras/hook-scripts/set/post/S30samba-set.sh
diff options
context:
space:
mode:
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
;;