get_token.sh
· 428 B · Bash
Исходник
#!/bin/bash
# curl -XPOST -d '{"type": "m.login.password", "identifier": {"user": "botusername", "type": "m.id.user"}, "password": "passwordforuser"}' "https://home.server/_matrix/client/r0/login"
USER=
PASSWORD=
HOMESERVER='https://'
STR="{\"type\": \"m.login.password\", \"identifier\": {\"user\": \"$USER\", \"type\": \"m.id.user\"}, \"password\": \"$PASSWORD\"}
curl -XPOST -d "$STR" "$HOMESERVER/_matrix/client/r0/login"
1 | #!/bin/bash |
2 | |
3 | # curl -XPOST -d '{"type": "m.login.password", "identifier": {"user": "botusername", "type": "m.id.user"}, "password": "passwordforuser"}' "https://home.server/_matrix/client/r0/login" |
4 | |
5 | USER= |
6 | PASSWORD= |
7 | HOMESERVER='https://' |
8 | |
9 | STR="{\"type\": \"m.login.password\", \"identifier\": {\"user\": \"$USER\", \"type\": \"m.id.user\"}, \"password\": \"$PASSWORD\"} |
10 | curl -XPOST -d "$STR" "$HOMESERVER/_matrix/client/r0/login" |