Skip to content

Commit 6625804

Browse files
committed
Use absolute path to script for CTL_ON environment variables
Now this script is easier to run outside the container, which is useful for quickly testing it. Example: cp .github/container/ejabberdctl.template . make dev export CTL_ON_START="! register user1 localhost somepass ; registered_users localhost" _build/dev/rel/ejabberd/bin/ejabberdctl foreground
1 parent 7e48c79 commit 6625804

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/container/ejabberdctl.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ERLANG_NODE=ejabberd@localhost
1212
# define default environment variables
1313
[ -z "$SCRIPT" ] && SCRIPT=$0
1414
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd -P)"
15+
SCRIPT_ABSOLUTE="$SCRIPT_DIR/$(basename "$SCRIPT")"
1516
# shellcheck disable=SC2034
1617
ERTS_VSN="{{erts_vsn}}"
1718
ERL="{{erl}}"
@@ -355,12 +356,12 @@ check_start()
355356

356357
post_waiter_fork()
357358
{
358-
(FIRST_RUN=$FIRST_RUN "$0" post_waiter)&
359+
(FIRST_RUN=$FIRST_RUN "$SCRIPT_ABSOLUTE" post_waiter)&
359360
}
360361

361362
post_waiter_waiting()
362363
{
363-
$0 started
364+
$SCRIPT_ABSOLUTE started
364365
[ -n "$FIRST_RUN" ] && [ -n "$CTL_ON_CREATE" ] && (post_waiter_loop $CTL_ON_CREATE)
365366
[ -n "$CTL_ON_START" ] && post_waiter_loop $CTL_ON_START
366367
}

0 commit comments

Comments
 (0)