Ensure that prosody directory is available

This commit is contained in:
Bob Mottram 2016-12-03 11:40:11 +00:00
parent f28b2081d1
commit 0f227587bb
1 changed files with 13 additions and 0 deletions

View File

@ -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"