浏览代码

Sleep anyway

Bob Mottram 8 年前
父节点
当前提交
840c7d652d
共有 1 个文件被更改,包括 3 次插入9 次删除
  1. 3
    9
      src/freedombone-app-matrix

+ 3
- 9
src/freedombone-app-matrix 查看文件

48
                   DEFAULT_DOMAIN_NAME)
48
                   DEFAULT_DOMAIN_NAME)
49
 
49
 
50
 function matrix_nginx {
50
 function matrix_nginx {
51
-    matrix_changed=
52
     matrix_proxy_str=' \
51
     matrix_proxy_str=' \
53
     location /matrix { \
52
     location /matrix { \
54
         proxy_pass https://localhost:8448; \
53
         proxy_pass https://localhost:8448; \
148
         fi
147
         fi
149
 
148
 
150
         nginx_ensite $DEFAULT_DOMAIN_NAME
149
         nginx_ensite $DEFAULT_DOMAIN_NAME
151
-        matrix_changed=1
152
     fi
150
     fi
153
 
151
 
154
     if ! grep "localhost:${MATRIX_PORT}" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
152
     if ! grep "localhost:${MATRIX_PORT}" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
155
         sed -i "s|:443 ssl;|:443 ssl;${matrix_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
153
         sed -i "s|:443 ssl;|:443 ssl;${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}
154
         sed -i "s| default_server;| default_server;${matrix_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
157
-        matrix_changed=1
158
     fi
155
     fi
159
     if ! grep "localhost:${TURN_PORT}" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
156
     if ! grep "localhost:${TURN_PORT}" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
160
         sed -i "s|:443 ssl;|:443 ssl;${turn_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
157
         sed -i "s|:443 ssl;|:443 ssl;${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}
158
         sed -i "s| default_server;| default_server;${turn_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
162
-        matrix_changed=1
163
     fi
159
     fi
164
 
160
 
165
-    if [ $matrix_changed ]; then
166
-        systemctl restart nginx
167
-        # wait for nginx to start otherwise user add fails later
168
-        sleep 5
169
-    fi
161
+    systemctl restart nginx
170
 
162
 
163
+    # wait for nginx to start otherwise user add fails later
164
+    sleep 5
171
 }
165
 }
172
 
166
 
173
 function matrix_generate_synapse_file {
167
 function matrix_generate_synapse_file {