Date: Wed, 3 Jul 1996 15:48:02 -0400 (EDT) From: Scanner <scanner@webspan.net> To: Jaye Mathisen <mrcpu@cdsnet.net> Cc: hackers@freebsd.org Subject: Re: Is there a real live actual working deluser script? Message-ID: <Pine.BSI.3.93.960703154514.13501A-100000@orion.webspan.net> In-Reply-To: <Pine.NEB.3.92.960703113607.22515Z-100000@schizo.cdsnet.net>
index | next in thread | previous in thread | raw e-mail
On Wed, 3 Jul 1996, Jaye Mathisen wrote:
>
>
> Even if it's rudimentary? I did a search on -hackers, and there's lots of
> talk about it, and about how complicated it would be, and on and on, but
> no actual script, and I don't see a port or a package.
Here is one that is like 2 lines mine and the rest gary's :)
Mine started out simeple as 4 lines. But under use of those less unix
knowledable it went haywire. So it was re-written all but 2 lines.
It works pretty good. Hope it does the job for you.
-------CUT HERE--------------
#!/bin/sh
if [ $# != 1 ]; then
echo "Please run as $0 <user>"
exit 1
fi
LUSER=$1
PASSWD=`egrep ^$1: /etc/passwd`
if [ -z "$PASSWD" ]; then
echo "No such user \"$LUSER\". Aborting."
exit 1
fi
GID=`echo $PASSWD | awk -F : ' { print $4 } '`
if [ $GID != "1001" ]; then
echo "\"$LUSER\" is not in group 1001 (users). Aborting."
exit 1
fi
echo "Removing $LUSER's files"
rm -r /home/$1
rm /var/mail/$1
rm /var/mail/.$1.pop
vipw
----------CUT HERE-------------
--
===================================| Webspan Inc., ISP Division.
FreeBSD 2.1.0 is available now! | Phone: 908-367-8030 ext. 126
-----------------------------------| 500 West Kennedy Blvd., Lakewood, NJ-08701
Turning PCs into Workstations | E-Mail: scanner@webspan.net
http://www.freebsd.org | SysAdmin / Network Engineer / Security
===================================| Member BSDNET team! http://www.bsdnet.org
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSI.3.93.960703154514.13501A-100000>
