mirror of
https://github.com/ThunixdotNet/makeuser.git
synced 2026-01-24 05:30:18 +00:00
move code to a function and add usage options
This commit is contained in:
11
rmuser
11
rmuser
@@ -3,6 +3,15 @@ CONFIG=./setenv
|
||||
|
||||
. $CONFIG
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
echo -e "Usage: `basename $0` [ username ]"
|
||||
else
|
||||
remove_user $1
|
||||
fi
|
||||
|
||||
remove_user()
|
||||
{
|
||||
echo "This will remove user account $1 from Thunix."
|
||||
echo "It is assumed the user account has been un-enforced in Ansible as well."
|
||||
|
||||
@@ -20,4 +29,4 @@ echo "Deleting account from system..."
|
||||
sudo userdel $1
|
||||
|
||||
echo "User $1 removed from system. Make sure user is unenforced in ansible." | sudo mail -s "User Account $1 removed from Thunix" $ADMIN_EMAIL
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user