forked from team/makeuser
26 lines
430 B
Bash
Executable File
26 lines
430 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 "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
|
|
|