diff options
author | Yurin Slava <YurinVV@ya.ru> | 2012-02-22 22:52:51 +0700 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2012-04-04 17:08:04 +0200 |
commit | cd1cc6dbeed8053c99751e633cc0372f9acc830b (patch) | |
tree | 43c3ecb20fe6f62630a117eba7a8508fec41c69c /priv/templates | |
parent | 4a9dae76a41cf963a56f73ea5a7933f285802fec (diff) |
simplenode.runner: properly quote arguments
bin/<release_name> console -kernel test '[{"a","b"}]' fails, because
when $@ is inserted into CMD [{"a","b"}] is interpreted.
Fix the same issue for 'start' command and quote all arguments.
Diffstat (limited to 'priv/templates')
-rwxr-xr-x | priv/templates/simplenode.runner | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/priv/templates/simplenode.runner b/priv/templates/simplenode.runner index 03b27aa..2fe888e 100755 --- a/priv/templates/simplenode.runner +++ b/priv/templates/simplenode.runner @@ -72,11 +72,12 @@ case "$1" in echo "Node is already running!" exit 1 fi + shift # remove $1 + RUN_PARAM=$(printf "\'%s\' " "$@") HEART_COMMAND="$RUNNER_BASE_DIR/bin/$SCRIPT start" export HEART_COMMAND mkdir -p $PIPE_DIR - shift # remove $1 - $ERTS_PATH/run_erl -daemon $PIPE_DIR $RUNNER_LOG_DIR "exec $RUNNER_BASE_DIR/bin/$SCRIPT console $@" 2>&1 + $ERTS_PATH/run_erl -daemon $PIPE_DIR $RUNNER_LOG_DIR "exec $RUNNER_BASE_DIR/bin/$SCRIPT console $RUN_PARAM" 2>&1 ;; stop) @@ -160,21 +161,21 @@ case "$1" in BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin EMU=beam PROGNAME=`echo $0 | sed 's/.*\\///'` - CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -mode embedded -config $CONFIG_PATH -args_file $VMARGS_PATH -- ${1+"$@"}" + CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -mode embedded -config $CONFIG_PATH -args_file $VMARGS_PATH" export EMU export ROOTDIR export BINDIR export PROGNAME # Dump environment info for logging purposes - echo "Exec: $CMD" + echo "Exec: $CMD" -- ${1+"$@"} echo "Root: $ROOTDIR" # Log the startup logger -t "$SCRIPT[$$]" "Starting up" # Start the VM - exec $CMD + exec $CMD -- ${1+"$@"} ;; *) |