diff --git a/src/freedombone b/src/freedombone index 5c3bf82d..ae66c46a 100755 --- a/src/freedombone +++ b/src/freedombone @@ -6847,7 +6847,15 @@ function install_xmpp { exit 65349 fi XMPP_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_xmpp/hostname) - echo "XMPP onion domain:${XMPP_ONION_HOSTNAME}" >> $COMPLETION_FILE + if ! grep -q "${XMPP_ONION_HOSTNAME}" /etc/prosody/conf.avail/xmpp.cfg.lua; then + echo "VirtualHost \"${XMPP_ONION_HOSTNAME}\"" >> /etc/prosody/conf.avail/xmpp.cfg.lua + echo ' modules_enabled = { "onions" };' >> /etc/prosody/conf.avail/xmpp.cfg.lua + fi + if ! grep -q "XMPP onion domain" $COMPLETION_FILE; then + echo "XMPP onion domain:${XMPP_ONION_HOSTNAME}" >> $COMPLETION_FILE + else + sed -i "s|XMPP onion domain.*|XMPP onion domain:${XMPP_ONION_HOSTNAME}|g" $COMPLETION_FILE + fi if ! grep -q "Your XMPP password is" /home/$MY_USERNAME/README; then if [ -f $IMAGE_PASSWORD_FILE ]; then