fix
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1,3 @@
|
|||||||
token.json
|
token.json
|
||||||
|
*.syu.is.json
|
||||||
|
*.syui.ai.json
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
function at_env_arg() {
|
function at_env_arg() {
|
||||||
handle=ai.syui.ai
|
handle=ai.syui.ai
|
||||||
col=ai.syui.verse.user
|
col=ai.syui.verse.user
|
||||||
rkey=self
|
|
||||||
host=syu.is
|
host=syu.is
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -12,7 +11,7 @@ function at_env() {
|
|||||||
cd $d
|
cd $d
|
||||||
dd=${0:a:h:h}
|
dd=${0:a:h:h}
|
||||||
pds=$host
|
pds=$host
|
||||||
f=$d/token.json
|
f=$d/${handle}.json
|
||||||
if [ ! -f $f ];then
|
if [ ! -f $f ];then
|
||||||
echo password
|
echo password
|
||||||
read password
|
read password
|
||||||
@@ -27,9 +26,12 @@ function at_env() {
|
|||||||
case $col in
|
case $col in
|
||||||
ai.syui.verse)
|
ai.syui.verse)
|
||||||
j=${j_verse}
|
j=${j_verse}
|
||||||
|
rkey=self
|
||||||
;;
|
;;
|
||||||
ai.syui.verse.user)
|
ai.syui.verse.user)
|
||||||
j=${j_user}
|
j=${j_user}
|
||||||
|
rkey=self
|
||||||
|
rkey=`echo $did|cut -d : -f 3`
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -83,16 +85,36 @@ function at_put_record() {
|
|||||||
"rkey": $rkey,
|
"rkey": $rkey,
|
||||||
"record": $record
|
"record": $record
|
||||||
}')
|
}')
|
||||||
|
|
||||||
echo $json
|
|
||||||
if echo $json|jq . ;then
|
if echo $json|jq . ;then
|
||||||
t=`curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $access" -d "$json" $url`
|
t=`curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $access" -d "$json" $url`
|
||||||
echo $t|jq .
|
echo $t|jq .
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function at_delete_record() {
|
||||||
|
req=com.atproto.repo.DeleteRecord
|
||||||
|
url=https://$pds/xrpc/$req
|
||||||
|
echo collection:
|
||||||
|
read col
|
||||||
|
echo rkey:
|
||||||
|
read rkey
|
||||||
|
json="{\"collection\":\"$col\", \"rkey\":\"$rkey\", \"repo\":\"$handle\"}"
|
||||||
|
if echo $json|jq . ;then
|
||||||
|
t=`curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $access" -d $json $url`
|
||||||
|
echo $t|jq .
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
at_env_arg
|
at_env_arg
|
||||||
at_env
|
at_env
|
||||||
at_create_session
|
at_create_session
|
||||||
at_refresh_session
|
at_refresh_session
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
d)
|
||||||
|
at_delete_record
|
||||||
|
;;
|
||||||
|
*)
|
||||||
at_put_record
|
at_put_record
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"character": [
|
"character": [
|
||||||
{ "id": 0, "cp": 100, "unique": true },
|
{ "id": 0, "cp": 100 , "mode": 2, "unique": false },
|
||||||
{ "id": 1, "cp": 100 , "unique": false }
|
{ "id": 1, "cp": 100 , "mode": 0, "unique": false }
|
||||||
],
|
],
|
||||||
"item": [
|
"item": [
|
||||||
{ "id": 0, "cp": 0 },
|
{ "id": 0, "cp": 0 },
|
||||||
|
Reference in New Issue
Block a user