head	1.7;
access;
symbols
	RELEASE_7_4_0:1.6
	RELEASE_8_2_0:1.6
	RELEASE_6_EOL:1.6
	RELEASE_8_1_0:1.6
	RELEASE_7_3_0:1.6
	RELEASE_8_0_0:1.6
	RELEASE_7_2_0:1.5
	RELEASE_7_1_0:1.5
	RELEASE_6_4_0:1.5
	RELEASE_5_EOL:1.5
	RELEASE_7_0_0:1.5
	RELEASE_6_3_0:1.5
	PRE_XORG_7:1.5
	RELEASE_4_EOL:1.5
	RELEASE_6_2_0:1.5
	RELEASE_6_1_0:1.3
	RELEASE_5_5_0:1.3
	old_RELEASE_6_0_0:1.1
	old_RELEASE_5_4_0:1.1;
locks; strict;
comment	@# @;


1.7
date	2011.05.08.04.34.15;	author bf;	state dead;
branches;
next	1.6;

1.6
date	2009.04.30.21.02.44;	author miwi;	state Exp;
branches;
next	1.5;

1.5
date	2006.06.22.14.15.00;	author johans;	state Exp;
branches;
next	1.4;

1.4
date	2006.06.05.13.23.45;	author pav;	state Exp;
branches;
next	1.3;

1.3
date	2006.02.17.22.21.25;	author mnag;	state Exp;
branches;
next	1.2;

1.2
date	2005.11.26.01.04.14;	author edwin;	state Exp;
branches;
next	1.1;

1.1
date	2005.01.30.14.55.57;	author pav;	state Exp;
branches;
next	;


desc
@@


1.7
log
@- update tor-devel to 0.2.3.1-alpha
- remove [de]install scripts from both
tor ports in favor of GROUPS/USERS
- fix mistakes in the _tor uid entry
introduced in the GROUPS/USERS changes
@
text
@#! /bin/sh
#
# taken from devel/perforce

PATH=/bin:/usr/sbin

TOR_USER=${TOR_USER:-_tor}
TOR_GROUP=${TOR_GROUP:-_tor}

case $2 in
PRE-INSTALL)
	USER=${TOR_USER}
	UID="256"
	GROUP=${TOR_GROUP}
	GID="256"

	if pw group show "${GROUP}" 2>/dev/null; then
		echo "You already have a group \"${GROUP}\", so I will use it."
	else
		if pw groupadd ${GROUP} -g ${GID}; then
			echo "Added group \"${GROUP}\"."
		else
			echo "Adding group \"${GROUP}\" failed..."
			exit 1
		fi
	fi

	if pw user show "${USER}" 2>/dev/null; then
		echo "You already have a user \"${USER}\", so I will use it."
	else
		if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
			-d /var/db/tor -c "Tor Daemon" -s /sbin/nologin
		then
			echo "Added user \"${USER}\"."
		else
			echo "Adding user \"${USER}\" failed..."
			exit 1
		fi
	fi

	;;
esac
@


1.6
log
@- Update to 0.2.1.14-rc
- Remove obsolete CELLPOOL option

PR:		133668
Submitted by:	bf <bf2006a@@yahoo.com>
Approved by:	maintainer
@
text
@@


1.5
log
@- Update to 1.1.21
- Fix uid/gid at 256 (as security/tor uses)

PR:		98784
Submitted by:	Fabian Keil, Peter Thoenen (maintainer)
Approved by:	flz (mentor)
@
text
@d32 1
a32 1
			-d /var/db/tor -c "Tor Daemon" -s /bin/sh
@


1.4
log
@- Update to 0.1.1.20

PR:		ports/98375
Submitted by:	Peter Thoenen <peter.thoenen@@yahoo.com> <eol1@@yahoo.com> (maintainer)
@
text
@d13 1
d15 1
d20 1
a20 1
		if pw groupadd ${GROUP} ; then
d31 1
a31 1
		if pw useradd ${USER} -g ${GROUP} -h - \
@


1.3
log
@- Update to 0.1.1.13
- Correct way to use USE_RC_SUBR
- Update MAINTAINER email

PR:		93314
Submitted by:	maintainer
@
text
@d30 1
a30 1
			-d /nonexistent -c "Tor Daemon" -s /bin/sh
@


1.2
log
@New Port: security/tor-devel

	New Port: security/tor-devel .  Track tor development branch.

PR:		ports/87759
Submitted by:	Peter Thoenen <eol1@@yahoo.com>
@
text
@d1 3
a3 1
#!/bin/sh
d5 36
a40 33
if [ x"$2" = xPRE-INSTALL ]; then
    USER="_tor"
    UID="256"
    GROUP="_tor"
    GID="256"

   if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
       echo "You already have a group \"${GROUP}\", so I will use it."
   else
       if /usr/sbin/pw groupadd ${GROUP} -g ${GID}; then
           echo "Added group \"${GROUP}\"."
       else
           echo "Adding group \"${GROUP}\" failed..."
           echo "Please create it, and try again."
           exit 1
       fi
   fi

   if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
       echo "You already have a user \"${USER}\", so I will use it."
   else
       if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
           -d /var/db/tor \
           -s /bin/sh \
           -c "Tor anonymising router"; then
           echo "Added user \"${USER}\"."
       else
           echo "Adding user \"${USER}\" failed..."
           echo "Please create it, and try again."
           exit 1
       fi
   fi
fi
@


1.1
log
@- adds _tor user and gourp for tor to run as
- puts data into /var/db/tor/data  -  TAKE NOTE WHEN UPGRADING!
- working tor.sh!!! (finally. sorry for not doing this earlier!)

PR:		ports/76837
Submitted by:	rik <freebsd-ports@@rikrose.net> (maintainer)
@
text
@d9 11
a19 11
	if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
		echo "You already have a group \"${GROUP}\", so I will use it."
	else
		if /usr/sbin/pw groupadd ${GROUP} -g ${GID}; then
		    echo "Added group \"${GROUP}\"."
	    else
		    echo "Adding group \"${GROUP}\" failed..."
			echo "Please create it, and try again."
	    	exit 1
		fi
	fi
d21 4
a24 4
	if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
		echo "You already have a user \"${USER}\", so I will use it."
	else
		if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
d28 7
a34 7
	        echo "Added user \"${USER}\"."
	    else
	        echo "Adding user \"${USER}\" failed..."
	        echo "Please create it, and try again."
	        exit 1
	    fi
	fi
@

