diff options
author | tv <tv@krebsco.de> | 2018-04-25 00:30:35 +0300 |
---|---|---|
committer | tv <tv@krebsco.de> | 2018-04-25 01:41:30 +0300 |
commit | c43037887a78c27ba7c8d0913ae093b2dc74a5e7 (patch) | |
tree | 0fcb8588ef71b325aae5d06bdf9328f8f0a5d18e /ejabberdctl.template | |
parent | 538e0d4844ea43d6039d598717db62395604f21f (diff) |
ejabberdctl: fix parameter parsing
Diffstat (limited to 'ejabberdctl.template')
-rwxr-xr-x | ejabberdctl.template | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/ejabberdctl.template b/ejabberdctl.template index 1cf3a5d31..a940c3df7 100755 --- a/ejabberdctl.template +++ b/ejabberdctl.template @@ -41,19 +41,17 @@ case $(id -un) in esac # parse command line parameters -for arg; do - case $arg in - -n|--node) ERLANG_NODE_ARG=$2; shift;; - -s|--spool) SPOOL_DIR=$2; shift;; - -l|--logs) LOGS_DIR=$2; shift;; - -f|--config) EJABBERD_CONFIG_PATH=$2; shift;; - -c|--ctl-config) EJABBERDCTL_CONFIG_PATH=$2; shift;; - -d|--config-dir) ETC_DIR=$2; shift;; - -t|--no-timeout) NO_TIMEOUT="--no-timeout";; - --) :;; +while [ $# -gt 0 ]; do + case $1 in + -n|--node) ERLANG_NODE_ARG=$2; shift 2;; + -s|--spool) SPOOL_DIR=$2; shift 2;; + -l|--logs) LOGS_DIR=$2; shift 2;; + -f|--config) EJABBERD_CONFIG_PATH=$2; shift 2;; + -c|--ctl-config) EJABBERDCTL_CONFIG_PATH=$2; shift 2;; + -d|--config-dir) ETC_DIR=$2; shift 2;; + -t|--no-timeout) NO_TIMEOUT="--no-timeout"; shift;; *) break;; esac - shift done # define ejabberd variables if not already defined from the command line |