forked from team/makeuser
27 lines
509 B
Bash
Executable File
27 lines
509 B
Bash
Executable File
#!/bin/bash
|
|
CONFIG=./setenv
|
|
|
|
. $CONFIG
|
|
|
|
source include/functions
|
|
|
|
if [ -z $1 ]
|
|
then
|
|
echo -e "Usage: `basename $0` username [ --banned ][ --backup ]"
|
|
else
|
|
echo "This will remove user account $1 from Thunix."
|
|
echo "It is assumed the user account has been un-enforced in Ansible as well."
|
|
|
|
echo "Killing user processes..."
|
|
sudo pkill -9 -U $1
|
|
|
|
if [ -n $2 ]
|
|
then
|
|
[[ $2 == --backup ]] && backup_user_data $1
|
|
[[ $2 == --banned ]] && echo $1 | sudo tee -a $BANNED
|
|
fi
|
|
|
|
remove_user $1
|
|
fi
|
|
|