about summary refs log tree commit diff stats
path: root/bin/rmuser
diff options
context:
space:
mode:
authorahriman <ahriman@falte.red>2019-03-13 08:49:32 +0000
committerahriman <ahriman@falte.red>2019-03-13 08:49:32 +0000
commit55fdeef0e883f34e80dfca417a81ec57a31c8cda (patch)
tree61f64032a80eea2e765315866ba151370c88d945 /bin/rmuser
downloadadmin-55fdeef0e883f34e80dfca417a81ec57a31c8cda.tar.gz
refactor
Diffstat (limited to 'bin/rmuser')
-rwxr-xr-xbin/rmuser12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/rmuser b/bin/rmuser
new file mode 100755
index 0000000..b220181
--- /dev/null
+++ b/bin/rmuser
@@ -0,0 +1,12 @@
+#!/usr/local/bin/bash
+
+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"