2023-02-14 21:47:28 +01:00
|
|
|
printf "===> Preparing dev configuration files: "
|
2021-06-25 12:40:26 +02:00
|
|
|
|
2023-02-14 21:47:28 +01:00
|
|
|
PWD_DIR=$(pwd)
|
2021-07-15 21:30:36 +02:00
|
|
|
REL_DIR=$PWD_DIR/_build/dev/rel/ejabberd/
|
2022-04-25 12:46:48 +02:00
|
|
|
CON_DIR=$REL_DIR/conf/
|
2021-06-25 12:40:26 +02:00
|
|
|
|
2021-07-15 21:30:36 +02:00
|
|
|
[ -z "$REL_DIR_TEMP" ] && REL_DIR_TEMP=$REL_DIR
|
2022-04-25 12:46:48 +02:00
|
|
|
CON_DIR_TEMP=$REL_DIR_TEMP/conf/
|
2021-07-15 21:30:36 +02:00
|
|
|
|
2023-02-14 21:47:28 +01:00
|
|
|
cd $CON_DIR_TEMP || exit
|
2021-06-25 12:40:26 +02:00
|
|
|
|
2021-07-15 21:30:36 +02:00
|
|
|
sed -i "s|# certfiles:|certfiles:\n - $CON_DIR/cert.pem|g" ejabberd.yml.example
|
|
|
|
sed -i "s|certfiles:|ca_file: $CON_DIR/ca.pem\ncertfiles:|g" ejabberd.yml.example
|
|
|
|
sed -i 's|^acl:$|acl:\n admin: [user: admin]|g' ejabberd.yml.example
|
|
|
|
[ ! -f "$CON_DIR/ejabberd.yml" ] \
|
2023-02-14 21:47:28 +01:00
|
|
|
&& printf "ejabberd.yml " \
|
2021-07-15 21:30:36 +02:00
|
|
|
&& mv ejabberd.yml.example ejabberd.yml
|
2021-06-25 12:40:26 +02:00
|
|
|
|
2021-07-15 21:30:36 +02:00
|
|
|
sed -i "s|#' POLL|EJABBERD_BYPASS_WARNINGS=true\n\n#' POLL|g" ejabberdctl.cfg.example
|
|
|
|
[ ! -f "$CON_DIR/ejabberdctl.cfg" ] \
|
2023-02-14 21:47:28 +01:00
|
|
|
&& printf "ejabberdctl.cfg " \
|
2021-07-15 21:30:36 +02:00
|
|
|
&& mv ejabberdctl.cfg.example ejabberdctl.cfg
|
2021-06-25 12:40:26 +02:00
|
|
|
|
|
|
|
echo ""
|
2021-07-21 17:22:19 +02:00
|
|
|
echo "===> Some example ways to start this ejabberd dev:"
|
|
|
|
echo " _build/dev/rel/ejabberd/bin/ejabberdctl live"
|
2023-12-19 22:45:13 +01:00
|
|
|
case "$1" in
|
|
|
|
"rebar3")
|
|
|
|
echo " _build/dev/rel/ejabberd/bin/ejabberd console"
|
|
|
|
;;
|
|
|
|
"mix")
|
|
|
|
echo " RELEASE_NODE=ejabberd@localhost _build/dev/rel/ejabberd/bin/ejabberd start"
|
|
|
|
;;
|
|
|
|
"*")
|
|
|
|
;;
|
|
|
|
esac
|