From 0f227587bbb374fd041e5a74e9d0c690b7ddbd94 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 3 Dec 2016 11:40:11 +0000 Subject: [PATCH] Ensure that prosody directory is available --- src/freedombone-app-xmpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp index f978232a..688bbdef 100755 --- a/src/freedombone-app-xmpp +++ b/src/freedombone-app-xmpp @@ -298,6 +298,7 @@ function remove_xmpp { if [ -d /var/lib/prosody ]; then rm -rf /var/lib/prosody fi + groupdel prosody remove_completion_param install_xmpp sed -i '/xmpp/d' $COMPLETION_FILE @@ -419,6 +420,13 @@ function install_xmpp_main { exit 52367 fi + groupadd prosody + + if [ ! -d /var/lib/prosody ]; then + mkdir /var/lib/prosody + chown -R prosody:prosody /var/lib/prosody + fi + # obtain the prosody modules cd $INSTALL_DIR hg clone https://hg.prosody.im/prosody-modules/ prosody-modules @@ -590,7 +598,12 @@ function install_xmpp_main { XMPP_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" fi fi + prosodyctl register $MY_USERNAME $DEFAULT_DOMAIN_NAME "$XMPP_PASSWORD" + if [ ! "$?" = "0" ]; then + echo $'Unable to register prosody user' + exit 347682 + fi ${PROJECT_NAME}-pass -u $MY_USERNAME -a xmpp -p "$XMPP_PASSWORD"