diff --git a/src/freedombone-app-matrix b/src/freedombone-app-matrix index a0b789d3..105e8559 100755 --- a/src/freedombone-app-matrix +++ b/src/freedombone-app-matrix @@ -124,7 +124,11 @@ function add_user_matrix { cd /etc/matrix/scripts register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml https://localhost:${MATRIX_PORT} -u "${new_username}" -p "${new_user_password}" -a - echo '0' + if [ ! "$?" = "0" ]; then + echo '1' + else + echo "0" + fi } function install_interactive_matrix { @@ -355,6 +359,10 @@ function install_matrix { fi fi - add_user_matrix "${MY_USERNAME}" "${MATRIX_PASSWORD}" + if [[ $(add_user_matrix "${MY_USERNAME}" "${MATRIX_PASSWORD}") != "0" ]]; then + echo $'Failed to add matrix admin user'; + exit 879352 + fi + APP_INSTALLED=1 }