#!/bin/sh
#
# USAGE:
#
# Create the file /root/deluserlist.txt in the following format:
#
# USERNAME1:FIRSTNAME1:LASTNAME1
# USERNAME2:FIRSTNAME2:LASTNAME2
#
# and so on...
#
# This script will delete user accounts, mail accounts and pseudonyms
for all the listed users in the /root/deluserlist.txt file.
#
#
UFILE=/root/deluserlist.txt
if [ ! -f $UFILE ]; then
echo User database $UFILE missing
exit
fi
# export record=`cat $UFILE`
# if [ "$record" != "" ]; then
#
---------------------------------------------
# Note the lines below must be indented
# ------------------------------
for record in `cat $UFILE`
do
username=`echo $record | awk -F":"
{'print $1'}`
firstname=`echo $record | awk -F":"
{'print $2'}`
lastname=`echo $record | awk -F":"
{'print $3'}`
# ---------------------------------------------------------
# Delete Pseudonym (FIRSTNAME.LASTNAME@domain.org)
# Delete Pseudonym (FIRSTNAME_LASTNAME@domain.org)
# ---------------------------------------------------------
/sbin/e-smith/signal-event pseudonym-delete $firstname.$lastname $username
/sbin/e-smith/signal-event pseudonym-delete $firstname_$lastname $username
# ---------------
# Delete Username
# ---------------
/sbin/e-smith/signal-event user-delete $username
# ---------------
# Delete Account from Accounts Database
# ---------------
/sbin/e-smith/db accounts delete $username
done
|