25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-31 15:21:38 +01:00
xmpp.chapril.org-ejabberd/docker/scripts/pre/10_erlang_cookie.sh

26 lines
561 B
Bash
Raw Normal View History

2016-11-11 00:12:54 +01:00
#!/bin/bash
set -e
2016-11-11 00:12:54 +01:00
source "${EJABBERD_HOME}/scripts/lib/base_config.sh"
source "${EJABBERD_HOME}/scripts/lib/config.sh"
source "${EJABBERD_HOME}/scripts/lib/base_functions.sh"
source "${EJABBERD_HOME}/scripts/lib/functions.sh"
2016-11-11 00:12:54 +01:00
set_erlang_cookie() {
echo "Set erlang cookie to ${ERLANG_COOKIE}..."
2016-11-11 00:12:54 +01:00
echo ${ERLANG_COOKIE} > ${ERLANGCOOKIEFILE}
chmod 400 ${ERLANGCOOKIEFILE}
}
file_exist ${FIRST_START_DONE_FILE} \
&& exit 0
# set erlang cookie if ERLANG_COOKIE is set in environemt
is_set ${ERLANG_COOKIE} \
&& set_erlang_cookie
exit 0