mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Update setup-dev.sh to work perfectly both with rebar3 and mix
This commit is contained in:
parent
f35d304582
commit
1fd452dca9
@ -1,32 +1,34 @@
|
|||||||
echo -n "===> Preparing dev configuration files: "
|
echo -n "===> Preparing dev configuration files: "
|
||||||
|
|
||||||
PWD=`pwd`
|
PWD_DIR=`pwd`
|
||||||
REL_DIR=$PWD/_build/dev/rel/
|
REL_DIR=$PWD_DIR/_build/dev/rel/ejabberd/
|
||||||
CON_DIR=$REL_DIR/ejabberd/etc/ejabberd/
|
CON_DIR=$REL_DIR/etc/ejabberd/
|
||||||
BIN_DIR=$REL_DIR/ejabberd/bin/
|
BIN_DIR=$REL_DIR/bin/
|
||||||
CTLPATH=$BIN_DIR/ejabberdctl
|
CTLPATH=$BIN_DIR/ejabberdctl
|
||||||
|
|
||||||
[ ! -f "ejabberdctl" ] \
|
[ -z "$REL_DIR_TEMP" ] && REL_DIR_TEMP=$REL_DIR
|
||||||
|
CON_DIR_TEMP=$REL_DIR_TEMP/etc/ejabberd/
|
||||||
|
BIN_DIR_TEMP=$REL_DIR_TEMP/bin/
|
||||||
|
|
||||||
|
[ ! -e "ejabberdctl" ] \
|
||||||
&& echo -n "ejabberdctl " \
|
&& echo -n "ejabberdctl " \
|
||||||
&& ln -s $CTLPATH ejabberdctl
|
&& ln -s $CTLPATH ejabberdctl
|
||||||
|
|
||||||
(cd $BIN_DIR && sed -i "s|^SCRIPT_DIR=.*|SCRIPT_DIR=`pwd`|g" ejabberdctl)
|
# (cd $BIN_DIR_TEMP && sed -i "s|^SCRIPT_DIR=.*|SCRIPT_DIR=$REL_DIR|g" ejabberdctl)
|
||||||
|
|
||||||
cd $CON_DIR
|
cd $CON_DIR_TEMP
|
||||||
|
|
||||||
[ ! -f "ejabberd.yml" ] \
|
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" ] \
|
||||||
&& echo -n "ejabberd.yml " \
|
&& echo -n "ejabberd.yml " \
|
||||||
&& mv ejabberd.yml.example ejabberd.yml \
|
&& mv ejabberd.yml.example ejabberd.yml
|
||||||
&& sed -i "s|# certfiles:|certfiles:\n - $CON_DIR/cert.pem|g" ejabberd.yml \
|
|
||||||
&& sed -i "s|certfiles:|ca_file: $CON_DIR/ca.pem\ncertfiles:|g" ejabberd.yml \
|
|
||||||
&& sed -i 's|^acl:$|acl:\n admin: [user: admin]|g' ejabberd.yml \
|
|
||||||
|| rm ejabberd.yml.example
|
|
||||||
|
|
||||||
[ ! -f "ejabberdctl.cfg" ] \
|
sed -i "s|#' POLL|EJABBERD_BYPASS_WARNINGS=true\n\n#' POLL|g" ejabberdctl.cfg.example
|
||||||
|
[ ! -f "$CON_DIR/ejabberdctl.cfg" ] \
|
||||||
&& echo -n "ejabberdctl.cfg " \
|
&& echo -n "ejabberdctl.cfg " \
|
||||||
&& mv ejabberdctl.cfg.example ejabberdctl.cfg \
|
&& mv ejabberdctl.cfg.example ejabberdctl.cfg
|
||||||
&& sed -i "s|#' POLL|EJABBERD_BYPASS_WARNINGS=true\n\n#' POLL|g" ejabberdctl.cfg \
|
|
||||||
|| rm ejabberdctl.cfg.example
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "===> Now you can start this ejabberd dev with: ./ejabberdctl live"
|
echo "===> Now you can start this ejabberd dev with: ./ejabberdctl live"
|
||||||
|
Loading…
Reference in New Issue
Block a user