Ver código fonte

Ensure that prosody directory is available

Bob Mottram 8 anos atrás
pai
commit
0f227587bb
1 arquivos alterados com 13 adições e 0 exclusões
  1. 13
    0
      src/freedombone-app-xmpp

+ 13
- 0
src/freedombone-app-xmpp Ver arquivo

298
     if [ -d /var/lib/prosody ]; then
298
     if [ -d /var/lib/prosody ]; then
299
         rm -rf /var/lib/prosody
299
         rm -rf /var/lib/prosody
300
     fi
300
     fi
301
+    groupdel prosody
301
 
302
 
302
     remove_completion_param install_xmpp
303
     remove_completion_param install_xmpp
303
     sed -i '/xmpp/d' $COMPLETION_FILE
304
     sed -i '/xmpp/d' $COMPLETION_FILE
419
         exit 52367
420
         exit 52367
420
     fi
421
     fi
421
 
422
 
423
+    groupadd prosody
424
+
425
+    if [ ! -d /var/lib/prosody ]; then
426
+        mkdir /var/lib/prosody
427
+        chown -R prosody:prosody /var/lib/prosody
428
+    fi
429
+
422
     # obtain the prosody modules
430
     # obtain the prosody modules
423
     cd $INSTALL_DIR
431
     cd $INSTALL_DIR
424
     hg clone https://hg.prosody.im/prosody-modules/ prosody-modules
432
     hg clone https://hg.prosody.im/prosody-modules/ prosody-modules
590
             XMPP_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
598
             XMPP_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
591
         fi
599
         fi
592
     fi
600
     fi
601
+
593
     prosodyctl register $MY_USERNAME $DEFAULT_DOMAIN_NAME "$XMPP_PASSWORD"
602
     prosodyctl register $MY_USERNAME $DEFAULT_DOMAIN_NAME "$XMPP_PASSWORD"
603
+    if [ ! "$?" = "0" ]; then
604
+        echo $'Unable to register prosody user'
605
+        exit 347682
606
+    fi
594
 
607
 
595
     ${PROJECT_NAME}-pass -u $MY_USERNAME -a xmpp -p "$XMPP_PASSWORD"
608
     ${PROJECT_NAME}-pass -u $MY_USERNAME -a xmpp -p "$XMPP_PASSWORD"
596
 
609