forked from lda/telodendria
Fix broken tt script.
This commit is contained in:
parent
1f8df737da
commit
3192063340
1 changed files with 3 additions and 3 deletions
|
@ -12,7 +12,7 @@ register_payload() {
|
||||||
printf '{'
|
printf '{'
|
||||||
printf ' "auth": {'
|
printf ' "auth": {'
|
||||||
printf ' "type": "m.login.dummy",'
|
printf ' "type": "m.login.dummy",'
|
||||||
printf ' "session": %s' "$(json -e "$session")"
|
printf ' "session": %s' "$(json -e "$1")"
|
||||||
printf ' },'
|
printf ' },'
|
||||||
printf ' "username": %s,' "$(json -e "$USERNAME")"
|
printf ' "username": %s,' "$(json -e "$USERNAME")"
|
||||||
printf ' "password": %s,' "$PASSWORD"
|
printf ' "password": %s,' "$PASSWORD"
|
||||||
|
@ -34,8 +34,8 @@ login_payload() {
|
||||||
# Check if user is available. If it is, register it.
|
# Check if user is available. If it is, register it.
|
||||||
user_available=$(http "$BASE/_matrix/client/v3/register/available?username=$USERNAME" | json -s "available")
|
user_available=$(http "$BASE/_matrix/client/v3/register/available?username=$USERNAME" | json -s "available")
|
||||||
if [ "$user_available" = "true" ]; then
|
if [ "$user_available" = "true" ]; then
|
||||||
session=$(echo '{}' | http -X POST "$BASE/_matrix/client/v3/register" | json -s "session->@decode")
|
session=$(http -X POST -d '{}' "$BASE/_matrix/client/v3/register" | json -s "session->@decode")
|
||||||
register_payload | http -X POST -d @- "$BASE/_matrix/client/v3/register" > /dev/null
|
register_payload "$session" | http -X POST -d @- "$BASE/_matrix/client/v3/register" > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Log in
|
# Log in
|
||||||
|
|
Loading…
Reference in a new issue