makeuser/rmuser

27 lines
509 B
Plaintext
Raw Normal View History

#!/bin/bash
2019-12-06 15:40:49 +00:00
CONFIG=./setenv
. $CONFIG
2021-10-01 08:27:53 +00:00
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
2021-10-01 08:27:53 +00:00
if [ -n $2 ]
then
[[ $2 == --backup ]] && backup_user_data $1
[[ $2 == --banned ]] && echo $1 | sudo tee -a $BANNED
fi
2019-05-14 11:36:41 +00:00
remove_user $1
fi