forked from vern/scripts
31 lines
1.3 KiB
Bash
Executable File
31 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env -S bash -e
|
|
|
|
[[ -z "$1" ]] && {
|
|
printf 'Usage: %s username\n' "$0"
|
|
exit 1
|
|
}
|
|
|
|
#[[ -d "/sshfs/home/$1" ]] || {
|
|
# printf "User %s does not exist\n" "$1"
|
|
# exit 2
|
|
#}
|
|
|
|
read -rp "Delete user $1? [y/N] "
|
|
[[ $REPLY =~ [Yy] ]] && {
|
|
ssh 192.168.122.30 "tar -zcpvf - /home/${1}" > ~/"${1}"-data.tar.gz
|
|
ssh 192.168.122.30 "userdel -r '$1'; groupdel '$1'"
|
|
curl -XPOST -H "Authorization: Bearer $(</root/priv/root-access-token)" -H "Content-Type: application/json" -d '{"erase":true}' "http://localhost:8008/_synapse/admin/v1/deactivate/@$1:vern.cc"
|
|
su - mastodon -c "live/bin/tootctl accounts delete $1"
|
|
su - git -c "gitea admin user delete --username $1 -c /etc/gitea/app.ini"
|
|
sudo -u www-data php /var/www/nextcloud/occ user:delete "$1"
|
|
curl -s -X DELETE -H 'Content-Type: application/json' -H 'Authorization: Token '"$(</root/priv/modoboapitoken)"\
|
|
-d '{ id: "'"${1}"'" }'\
|
|
'https://mail.vern.cc/api/v2/accounts/'"${1}"
|
|
curl -s -X DELETE -H 'Content-Type: application/json' -H 'Authorization: Bearer '"$(peertube-authcode-gen)"\
|
|
'https://pt.vern.cc/api/v1/users/'"${1}"
|
|
prosodyctl deluser "$1"@vern.cc
|
|
prosodyctl deluser "$1"@jitsi.vern.cc
|
|
prosodyctl deluser "$1"@vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion
|
|
prosodyctl deluser "$1"@verncceu2kgz54wi7r5jatgmx2mqtsh3knxhiy4m5shescuqtqfa.b32.i2p
|
|
} || exit 3
|