vern-scripts/tilserv/mkpuser

10 lines
434 B
Bash
Executable File

#!/usr/bin/env -S bash -e
[[ -z "$2" ]] && {
printf "Usage: %s username password\n" "$0"
exit 1
}
curl -s -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer '"$(peertube-authcode-gen)"\
-d '{ "username": "'"$1"'", "password": "'"$2"'", "email": "'"$1"'@vern.cc", "videoQuota": -1, "videoQuotaDaily": -1, "channelName": "'"$1"'_channel", "role": 2, "adminFlags": 1 }'\
'https://pt.vern.cc/api/v1/users/'