about summary refs log tree commit diff stats
path: root/bin/rmuser
blob: db3ea382abaf28386887c1f46be216503e8357d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/local/bin/bash

# Hopefully, this never has to be used.
# Cleans up and removes a user from the system.
# gbmor <ben@gbmor.dev>

echo "Removing user $1 from the system"
userdel $1
echo "Cleaning /home and /var/www/users"
rm -rf /home/$1
rm -rf /var/www/users/$1
echo "Removing httpd config"
rm -f /etc/httpd/$1.conf
httpdpid=`pgrep httpd | awk 'NR==1{print $1}'`
kill -HUP $httpdpid
echo "Done! Don't forget to remove the appropriate include line from httpd-vusers.conf"