deployment: fix ejabberd setup
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 26 Sep 2012 00:58:08 +0000 (17:58 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 26 Sep 2012 00:58:08 +0000 (17:58 -0700)
deployment/install-osrf.sh

index 818e50e..d59b1fe 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 OSRF="opensrf-2.1.0"
 INSTALLDIR="/srv/openils"
+HOSTNAME="nonprod"
 DEFAULT_USER="sitkastaff"
 HOMEDIR="/home/${DEFAULT_USER}"
 SITKACONF="${HOMEDIR}/sysadmin"
@@ -56,13 +57,13 @@ ldconfig
  
 # as root
 echo "Setting up ejabberd..."
-mv /etc/ejabberd/ejabberd.cfg /etc/ejabberd/ejabberd.cfg.orig && cp ${SITKACONF}/files/etc/ejabberd/ejabberd.cfg/nonprod /etc/ejabberd/
+cp ${SITKACONF}/files/etc/ejabberd/ejabberd.cfg/${HOSTNAME} /etc/ejabberd/ejabberd.cfg
 chgrp ejabberd /etc/ejabberd/ejabberd.cfg
 chmod 640 /etc/ejabberd/ejabberd.cfg
-/etc/init.d/ejabberd restart
-ejabberdctl register router private.localhost $PRIVATE_ROUTER_PASSWD
-ejabberdctl register opensrf private.localhost $PRIVATE_OPENSRF_PASSWD
-ejabberdctl register router public.localhost $PUBLIC_ROUTER_PASSWD
-ejabberdctl register opensrf public.localhost $PUBLIC_OPENSRF_PASSWD
+/etc/init.d/ejabberd restart && sleep 10 && \
+  ejabberdctl register router private.localhost ${PRIVATE_ROUTER_PASSWD} && \
+  ejabberdctl register opensrf private.localhost ${PRIVATE_OPENSRF_PASSWD} && \
+  ejabberdctl register router public.localhost ${PUBLIC_ROUTER_PASSWD} && \
+  ejabberdctl register opensrf public.localhost ${PUBLIC_OPENSRF_PASSWD}
 
 echo "OpenSRF is installed!"