Bob Mottram 8 anos atrás
pai
commit
f0eb273dc6
1 arquivos alterados com 10 adições e 3 exclusões
  1. 10
    3
      src/freedombone-app-matrix

+ 10
- 3
src/freedombone-app-matrix Ver arquivo

48
                   DEFAULT_DOMAIN_NAME)
48
                   DEFAULT_DOMAIN_NAME)
49
 
49
 
50
 function matrix_nginx {
50
 function matrix_nginx {
51
+    matrix_changed=
51
     matrix_proxy_str=' \
52
     matrix_proxy_str=' \
52
     location /matrix { \
53
     location /matrix { \
53
         proxy_pass https://localhost:8448; \
54
         proxy_pass https://localhost:8448; \
147
         fi
148
         fi
148
 
149
 
149
         nginx_ensite $DEFAULT_DOMAIN_NAME
150
         nginx_ensite $DEFAULT_DOMAIN_NAME
151
+        matrix_changed=1
150
     fi
152
     fi
151
 
153
 
152
     if ! grep "localhost:${MATRIX_PORT}" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
154
     if ! grep "localhost:${MATRIX_PORT}" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
153
         sed -i "s|:443 ssl;|:443 ssl;${matrix_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
155
         sed -i "s|:443 ssl;|:443 ssl;${matrix_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
154
         sed -i "s| default_server;| default_server;${matrix_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
156
         sed -i "s| default_server;| default_server;${matrix_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
157
+        matrix_changed=1
155
     fi
158
     fi
156
     if ! grep "localhost:${TURN_PORT}" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
159
     if ! grep "localhost:${TURN_PORT}" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
157
         sed -i "s|:443 ssl;|:443 ssl;${turn_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
160
         sed -i "s|:443 ssl;|:443 ssl;${turn_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
158
         sed -i "s| default_server;| default_server;${turn_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
161
         sed -i "s| default_server;| default_server;${turn_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
162
+        matrix_changed=1
163
+    fi
164
+
165
+    if [ $matrix_changed ]; then
166
+        systemctl restart nginx
167
+        sleep 5
159
     fi
168
     fi
160
 
169
 
161
-    systemctl restart nginx
162
 }
170
 }
163
 
171
 
164
 function matrix_generate_synapse_file {
172
 function matrix_generate_synapse_file {
247
 
255
 
248
     ${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
256
     ${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
249
 
257
 
250
-    read_config_param 'MATRIX_SECRET'
251
     matrix_nginx
258
     matrix_nginx
252
-    register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" -a
259
+    retval=$(register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" -a)
253
     echo "0"
260
     echo "0"
254
 }
261
 }
255
 
262