Browse Source

Check that user is added

Bob Mottram 8 years ago
parent
commit
4660718b9c
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      src/freedombone-app-matrix

+ 10
- 2
src/freedombone-app-matrix View File

124
 
124
 
125
     cd /etc/matrix/scripts
125
     cd /etc/matrix/scripts
126
     register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml https://localhost:${MATRIX_PORT} -u "${new_username}" -p "${new_user_password}" -a
126
     register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml https://localhost:${MATRIX_PORT} -u "${new_username}" -p "${new_user_password}" -a
127
-    echo '0'
127
+    if [ ! "$?" = "0" ]; then
128
+        echo '1'
129
+    else
130
+        echo "0"
131
+    fi
128
 }
132
 }
129
 
133
 
130
 function install_interactive_matrix {
134
 function install_interactive_matrix {
355
         fi
359
         fi
356
     fi
360
     fi
357
 
361
 
358
-    add_user_matrix "${MY_USERNAME}" "${MATRIX_PASSWORD}"
362
+    if [[ $(add_user_matrix "${MY_USERNAME}" "${MATRIX_PASSWORD}") != "0" ]]; then
363
+        echo $'Failed to add matrix admin user';
364
+        exit 879352
365
+    fi
366
+
359
     APP_INSTALLED=1
367
     APP_INSTALLED=1
360
 }
368
 }