From 4de59f40d8696fc59a89d6abf2f1b85eb129947f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 17 May 2017 22:05:05 +0100 Subject: [PATCH] Remove any existing xmpp install before starting new one --- src/freedombone-app-xmpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp index 82d92d11..1e7967e6 100755 --- a/src/freedombone-app-xmpp +++ b/src/freedombone-app-xmpp @@ -508,10 +508,10 @@ function remove_xmpp { remove_onion_service xmpp 5222 5223 5269 apt-get -yq remove --purge prosody - if [ ! -f $INSTALL_DIR/$prosody_modules_filename ]; then + if [ -f $INSTALL_DIR/$prosody_modules_filename ]; then rm $INSTALL_DIR/$prosody_modules_filename fi - if [ ! -d $INSTALL_DIR/prosody-modules ]; then + if [ -d $INSTALL_DIR/prosody-modules ]; then rm -rf $INSTALL_DIR/prosody-modules fi if [ -d /etc/prosody ]; then @@ -793,6 +793,18 @@ function install_xmpp_nightly { } function install_xmpp { + if [ ! -d $INSTALL_DIR ]; then + mkdir -p $INSTALL_DIR + fi + + # remove any existing install attempt + if [ -f $INSTALL_DIR/$prosody_modules_filename ]; then + rm $INSTALL_DIR/$prosody_modules_filename + fi + if [ -d $INSTALL_DIR/prosody-modules ]; then + rm -rf $INSTALL_DIR/prosody-modules + fi + update_prosody_modules if [[ $ONION_ONLY == 'no' ]]; then