vern-scripts/tilserv/mkfuser

9 lines
372 B
Plaintext
Raw Normal View History

2022-11-09 17:03:47 +00:00
#!/usr/bin/env -S bash -e
[[ -z "$1" ]] && {
printf "Usage: %s username [user|admin]\n" "$0"
2022-11-09 17:03:47 +00:00
exit 1
}
2023-05-18 17:45:30 +00:00
su - mastodon -s /bin/bash -c "live/bin/tootctl accounts create \"$1\" --email=\"${1}@vern.cc\" --confirmed $([[ "$2" == "admin" ]] && printf -- '--role=Admin' || [[ "$2" == "owner" ]] && printf -- '--role=Owner'); live/bin/tootctl accounts modify \"$1\" --approve"