mirror of
https://github.com/ThunixdotNet/makeuser.git
synced 2026-11-06 12:15:38 +00:00
move code to a function and add usage options
This commit is contained in:
1 parent
e74b9287dc
commit
f9c526342e
1 file changed
+10
-1
@@ -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