From 39544a6b21d48a9c3e93fe089e1c7f53373ff0ee Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Fri, 30 Dec 2016 20:47:04 +0000
Subject: [PATCH] adding user

---
 src/freedombone-app-matrix | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/freedombone-app-matrix b/src/freedombone-app-matrix
index edc79ca72..27dd8da67 100755
--- a/src/freedombone-app-matrix
+++ b/src/freedombone-app-matrix
@@ -130,6 +130,9 @@ function add_user_matrix {
     ${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
 
     read_config_param 'MATRIX_SECRET'
+    if [ -f /var/lib/matrix/.synapse/bin/activate ]; then
+        source /var/lib/matrix/.synapse/bin/activate
+    fi
     register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml https://localhost:${MATRIX_PORT} -u "${new_username}" -p "${new_user_password}" -a
     if [ ! "$?" = "0" ]; then
         echo '1'
@@ -349,7 +352,7 @@ function install_matrix {
     echo 'Type=simple' >> /etc/systemd/system/matrix.service
     echo 'User=matrix' >> /etc/systemd/system/matrix.service
     echo "WorkingDirectory=/etc/matrix" >> /etc/systemd/system/matrix.service
-    echo "ExecStart=source /var/lib/matrix/.synapse/bin/activate && /usr/bin/python -m synapse.app.homeserver --config-path ${MATRIX_DATA_DIR}/homeserver.yaml" >> /etc/systemd/system/matrix.service
+    echo "ExecStart=/usr/bin/python -m synapse.app.homeserver --config-path ${MATRIX_DATA_DIR}/homeserver.yaml" >> /etc/systemd/system/matrix.service
     echo 'Restart=always' >> /etc/systemd/system/matrix.service
     echo 'RestartSec=10' >> /etc/systemd/system/matrix.service
     echo '' >> /etc/systemd/system/matrix.service
-- 
GitLab