From owner-freebsd-hackers Wed Jul 3 12:48:14 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id MAA19140 for hackers-outgoing; Wed, 3 Jul 1996 12:48:14 -0700 (PDT) Received: from orion.webspan.net (root@orion.webspan.net [206.154.70.41]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id MAA19133 for ; Wed, 3 Jul 1996 12:48:12 -0700 (PDT) Received: from orion.webspan.net (scanner@orion.webspan.net [206.154.70.41]) by orion.webspan.net (8.7.5/8.6.12) with SMTP id PAA13654; Wed, 3 Jul 1996 15:48:02 -0400 (EDT) Date: Wed, 3 Jul 1996 15:48:02 -0400 (EDT) From: Scanner To: Jaye Mathisen cc: hackers@freebsd.org Subject: Re: Is there a real live actual working deluser script? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 " 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