File: setup-dev.sh

package info (click to toggle)
ejabberd 26.02-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,396 kB
  • sloc: erlang: 122,646; sh: 4,258; sql: 3,633; perl: 869; makefile: 559; javascript: 216; python: 48
file content (36 lines) | stat: -rwxr-xr-x 1,163 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
printf "===> Preparing dev configuration files: "

PWD_DIR=$(pwd)
REL_DIR=$PWD_DIR/_build/dev/rel/ejabberd/
CON_DIR=$REL_DIR/conf/

[ -z "$REL_DIR_TEMP" ] && REL_DIR_TEMP=$REL_DIR
CON_DIR_TEMP=$REL_DIR_TEMP/conf/

cd $CON_DIR_TEMP || exit

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" ] \
    && printf "ejabberd.yml " \
    && mv ejabberd.yml.example ejabberd.yml

sed -i "s|#' POLL|EJABBERD_BYPASS_WARNINGS=true\n\n#' POLL|g" ejabberdctl.cfg.example
[ ! -f "$CON_DIR/ejabberdctl.cfg" ] \
    && printf "ejabberdctl.cfg " \
    && mv ejabberdctl.cfg.example ejabberdctl.cfg

echo ""
echo "===> Some example ways to start this ejabberd dev:"
echo "     _build/dev/rel/ejabberd/bin/ejabberdctl live"
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