Bladeren bron

Remove any existing xmpp install before starting new one

Bob Mottram 8 jaren geleden
bovenliggende
commit
4de59f40d8
1 gewijzigde bestanden met toevoegingen van 14 en 2 verwijderingen
  1. 14
    2
      src/freedombone-app-xmpp

+ 14
- 2
src/freedombone-app-xmpp Bestand weergeven

508
     remove_onion_service xmpp 5222 5223 5269
508
     remove_onion_service xmpp 5222 5223 5269
509
 
509
 
510
     apt-get -yq remove --purge prosody
510
     apt-get -yq remove --purge prosody
511
-    if [ ! -f $INSTALL_DIR/$prosody_modules_filename ]; then
511
+    if [ -f $INSTALL_DIR/$prosody_modules_filename ]; then
512
         rm $INSTALL_DIR/$prosody_modules_filename
512
         rm $INSTALL_DIR/$prosody_modules_filename
513
     fi
513
     fi
514
-    if [ ! -d $INSTALL_DIR/prosody-modules ]; then
514
+    if [ -d $INSTALL_DIR/prosody-modules ]; then
515
         rm -rf $INSTALL_DIR/prosody-modules
515
         rm -rf $INSTALL_DIR/prosody-modules
516
     fi
516
     fi
517
     if [ -d /etc/prosody ]; then
517
     if [ -d /etc/prosody ]; then
793
 }
793
 }
794
 
794
 
795
 function install_xmpp {
795
 function install_xmpp {
796
+    if [ ! -d $INSTALL_DIR ]; then
797
+        mkdir -p $INSTALL_DIR
798
+    fi
799
+
800
+    # remove any existing install attempt
801
+    if [ -f $INSTALL_DIR/$prosody_modules_filename ]; then
802
+        rm $INSTALL_DIR/$prosody_modules_filename
803
+    fi
804
+    if [ -d $INSTALL_DIR/prosody-modules ]; then
805
+        rm -rf $INSTALL_DIR/prosody-modules
806
+    fi
807
+
796
     update_prosody_modules
808
     update_prosody_modules
797
 
809
 
798
     if [[ $ONION_ONLY == 'no' ]]; then
810
     if [[ $ONION_ONLY == 'no' ]]; then