Skip to content

Commit a541c79

Browse files
authored
Replace $RANDOM with PID to support non-bash (#218)
1 parent b07e6ae commit a541c79

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

priv/base/runner

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ case "$1" in
306306
echo "Remote Shell: Use \"Ctrl-G q\" to quit."
307307
echo "q() or init:stop() will terminate the $SCRIPT node."
308308
shift
309-
RAND=$(($(($RANDOM % 1000)) + 1))
309+
RAND=$(($(($$ % 1000)) + 1))
310310
NODE_NAME=${NAME_ARG#* }
311-
exec $ERTS_PATH/erl -name c_$RAND_$NODE_NAME -hidden -remsh $NODE_NAME $COOKIE_ARG $NET_TICKTIME_ARG
311+
exec $ERTS_PATH/erl -name c$RAND$NODE_NAME -hidden -remsh $NODE_NAME $COOKIE_ARG $NET_TICKTIME_ARG
312312
;;
313313

314314
console)
@@ -363,7 +363,7 @@ case "$1" in
363363
node_up_check
364364

365365
shift
366-
RAND=$(($(($RANDOM % 1000)) + 1))
366+
RAND=$(($(($$ % 1000)) + 1))
367367
NODE_NAME=${NAME_ARG#* }
368368
$ERTS_PATH/erl -noshell -noinput \
369369
-pa $RUNNER_PATCH_DIR \

0 commit comments

Comments
 (0)