aboutsummaryrefslogtreecommitdiffstats
path: root/priv/templates
diff options
context:
space:
mode:
Diffstat (limited to 'priv/templates')
-rwxr-xr-xpriv/templates/extended_bin19
1 files changed, 18 insertions, 1 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin
index ac74358..1e8aa63 100755
--- a/priv/templates/extended_bin
+++ b/priv/templates/extended_bin
@@ -167,7 +167,7 @@ relx_rem_sh() {
# Setup remote shell command to control node
exec "$BINDIR/erl" "$NAME_TYPE" "$id" -remsh "$NAME" -boot start_clean \
-boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
- -setcookie "$COOKIE" -hidden -kernel net_ticktime $TICKTIME
+ -setcookie "$COOKIE" -hidden -kernel net_ticktime $TICKTIME $VM_ARGS
}
# Generate a random id
@@ -179,6 +179,8 @@ relx_gen_id() {
relx_nodetool() {
command="$1"; shift
+ escript_emulator_args $ROOTDIR/bin/nodetool
+
"$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
-setcookie "$COOKIE" "$command" $@
}
@@ -228,6 +230,19 @@ replace_os_vars() {
}1' < "$1" > "$2"
}
+escript_emulator_args() {
+ if [ -n "${VM_ARGS}" ]; then
+ if grep -q '%%!' $1; then
+ cmd=$(echo sed -i"' '" "'s|%%!.*|%%! ${VM_ARGS}|'" $1)
+ eval "$cmd"
+ else
+ cmd=$(echo sed -i"' '" "'/#!.*/ a \\
+%%! ${VM_ARGS}\n'" $1)
+ eval "$cmd"
+ fi
+ fi
+}
+
add_path() {
# Use $CWD/$1 if exists, otherwise releases/VSN/$1
IN_FILE_PATH=$2
@@ -442,6 +457,8 @@ else
COOKIE="$(echo "$COOKIE_ARG" | awk '{print $2}')"
fi
+VM_ARGS="$(grep -v -E '^#|^-name|^-sname|^-setcookie|^-args_file' "$VMARGS_PATH" | xargs | sed -e 's/ / /g')"
+
cd "$ROOTDIR"
# Check the first argument for instructions