2023-10-20 14:31:16 +00:00
|
|
|
function token() {
|
2024-02-17 08:35:49 +00:00
|
|
|
mkdir -p ~/.config/ai
|
|
|
|
echo server:
|
|
|
|
read host
|
|
|
|
|
|
|
|
echo password:
|
|
|
|
read pass
|
|
|
|
|
|
|
|
echo handle:
|
|
|
|
read handle
|
|
|
|
|
|
|
|
echo "{ \"host\":\"$host\", \"password\":\"$pass\", \"handle\":\"$handle\" }" >> $cfg
|
|
|
|
|
2023-10-20 14:31:16 +00:00
|
|
|
url=https://$host/xrpc/com.atproto.server.createSession
|
|
|
|
j=`curl -sL -X POST -H "Content-Type: application/json" -d "{\"identifier\":\"$handle\",\"password\":\"$pass\"}" $url`
|
|
|
|
echo $j
|
|
|
|
echo $j >! $cfg.t
|
|
|
|
}
|