head	1.4;
access;
symbols
	RELEASE_7_4_0:1.3
	RELEASE_8_2_0:1.3
	RELEASE_6_EOL:1.3
	RELEASE_8_1_0:1.3
	RELEASE_7_3_0:1.3
	RELEASE_8_0_0:1.3
	RELEASE_7_2_0:1.2
	RELEASE_7_1_0:1.2
	RELEASE_6_4_0:1.2
	RELEASE_5_EOL:1.2
	RELEASE_7_0_0:1.2
	RELEASE_6_3_0:1.2
	PRE_XORG_7:1.2
	RELEASE_4_EOL:1.2
	RELEASE_6_2_0:1.2
	RELEASE_6_1_0:1.1
	RELEASE_5_5_0:1.1
	RELEASE_6_0_0:1.1
	RELEASE_5_4_0:1.1;
locks; strict;
comment	@# @;


1.4
date	2011.05.08.04.34.14;	author bf;	state dead;
branches;
next	1.3;

1.3
date	2009.07.07.20.23.57;	author miwi;	state Exp;
branches;
next	1.2;

1.2
date	2006.08.03.09.49.00;	author johans;	state Exp;
branches;
next	1.1;

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


desc
@@


1.4
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.3
log
@- Update to 0.2.0.35

PR:		136115 (based on)
Submitted by:	Sylvio Cesar <scjamorim@@bsd.com.br>
		"b. f." <bf1783@@googlemail.com>
@
text
@@


1.2
log
@- Update tor to 1.1.20 (former development branch)
- Submitter becomes new maintainer (approved by old maintainer)
- Use rc.subr

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


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
@d1 3
a3 1
#!/bin/sh
d5 1
a5 5
if [ x"$2" = xPRE-INSTALL ]; then
    USER="_tor"
    UID="256"
    GROUP="_tor"
    GID="256"
d7 11
a17 1
	if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
d20 5
a24 6
		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
d28 1
a28 1
	if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
d31 8
a38 10
		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
d40 3
a42 1
fi
@

