create-invite-code.sh
1 #!/bin/bash 2 set -o errexit 3 set -o nounset 4 set -o pipefail 5 6 PDS_ENV_FILE=${PDS_ENV_FILE:-"/pds/pds.env"} 7 source "${PDS_ENV_FILE}" 8 9 curl \ 10 --fail \ 11 --silent \ 12 --show-error \ 13 --request POST \ 14 --user "admin:${PDS_ADMIN_PASSWORD}" \ 15 --header "Content-Type: application/json" \ 16 --data '{"useCount": 1}' \ 17 "https://${PDS_HOSTNAME}/xrpc/com.atproto.server.createInviteCode" | jq --raw-output '.code'