Add sleep

This commit is contained in:
Bob Mottram 2016-12-30 23:54:44 +00:00
parent a788b7e901
commit f0eb273dc6
1 changed files with 10 additions and 3 deletions

View File

@ -48,6 +48,7 @@ matrix_variables=(ONION_ONLY
DEFAULT_DOMAIN_NAME)
function matrix_nginx {
matrix_changed=
matrix_proxy_str=' \
location /matrix { \
proxy_pass https://localhost:8448; \
@ -147,18 +148,25 @@ function matrix_nginx {
fi
nginx_ensite $DEFAULT_DOMAIN_NAME
matrix_changed=1
fi
if ! grep "localhost:${MATRIX_PORT}" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
sed -i "s|:443 ssl;|:443 ssl;${matrix_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
sed -i "s| default_server;| default_server;${matrix_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
matrix_changed=1
fi
if ! grep "localhost:${TURN_PORT}" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
sed -i "s|:443 ssl;|:443 ssl;${turn_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
sed -i "s| default_server;| default_server;${turn_proxy_str}|g" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
matrix_changed=1
fi
if [ $matrix_changed ]; then
systemctl restart nginx
sleep 5
fi
}
function matrix_generate_synapse_file {
@ -247,9 +255,8 @@ function add_user_matrix {
${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
read_config_param 'MATRIX_SECRET'
matrix_nginx
register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" -a
retval=$(register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" -a)
echo "0"
}