Adding some more to rmuser

This commit is contained in:
Ubergeek 2019-05-14 11:36:41 +00:00
parent 6cb4e90d5b
commit 703152887c
1 changed files with 10 additions and 1 deletions

11
rmuser
View File

@ -1,5 +1,14 @@
#!/bin/bash
echo "This will remove user account $1 from Thunix."
echo "It is assumed the user account has been un-enforced in Ansible as well."
sudo pkill -U $1
echo "Killing user processes..."
sudo pkill -9 -U $1
echo "Arching home dir..."
sudo tar cfz /home/$1.tgz /home/$1
echo "Deleting account from system..."
sudo userdel $1
sudo mail -s "User Account $1 removed from Thunix" root@thunix.net