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