tor: 0.1.2.18 -> 0.1.2.19

This commit is contained in:
Danny Rawlins 2008-01-18 13:21:04 +11:00
parent ae3f82a8c2
commit 99056c3d09
4 changed files with 37 additions and 29 deletions

View File

@ -1,2 +1,2 @@
6cfe65643f3874a9709f0c19e7c648e0 tor-0.1.2.18.tar.gz
4b3f9963b843010af5aa3bd6266d11e0 tor-0.1.2.19.tar.gz
128bcc0a2ae7a3a6fa86935cabeb9a4b tor.rc

View File

@ -5,7 +5,7 @@
# Depends on: libevent
name=tor
version=0.1.2.18
version=0.1.2.19
release=1
source=(http://tor.eff.org/dist/tor-$version.tar.gz \
tor.rc)

View File

@ -7,8 +7,9 @@ PRECAUTION:
PRE-INSTALL:
Tor expects to have a user and group dedicated to it, a pre-install script has
been added to the port which takes care of this.
Tor expects to have a user and group dedicated to it, a
pre-install script has been added to the port which takes
care of this.
POST-INSTALL:
@ -18,5 +19,6 @@ POST-REMOVE:
NOTES:
Please edit /etc/tor/torrc and add "tor" to the SERVICES array in /etc/rc.conf
Please edit /etc/tor/torrc and add "tor" to the SERVICES
array in /etc/rc.conf

54
tor/pre-install Normal file → Executable file
View File

@ -8,29 +8,35 @@ USER_COMMENT="Tor Daemon"
USER_HOME=/var/empty
USER_SHELL=/bin/sh
if [ $GROUP ]
then
if ! grep -qi $GROUP /etc/group
then
/usr/sbin/groupadd $GROUP
if [ $? -eq 0 ]
then
echo "Group: $GROUP added."
fi
else
echo "Group: $GROUP already exists! Skipping."
fi
fi
if ! grep -qi $USER /etc/shadow
then
/usr/sbin/useradd -g $GROUP -c "$USER_COMMENT" -d $USER_HOME -s $USER_SHELL $USER
if [ $? -eq 0 ]
then
/usr/bin/passwd -l $USER
echo "User: $USER added."
fi
else
echo "User: $USER already exists! Skipping."
if [ ! $(id -u) = 0 ]; then
echo "ERROR: you need to be root to run this!"
exit 1
fi
if [ $GROUP ]; then
if ! getent group $GROUP > /dev/null; then
/usr/sbin/groupadd $GROUP
if [ $? -eq 0 ]; then
echo "Group: $GROUP added."
fi
else
echo "Group: $GROUP already exists! Skipping."
fi
fi
if ! getent passwd $USER > /dev/null; then
/usr/sbin/useradd -g $GROUP -c "$USER_COMMENT" -d $USER_HOME -s $USER_SHELL $USER
if [ $? -eq 0 ]; then
echo "User: $USER added."
/usr/bin/passwd -l $USER
if [ $? -eq 0 ]; then
echo "Locked $USER account."
fi
else
echo "ERROR: unable to lock $USER account."
/usr/sbin/userdel $USER
fi
else
echo "User: $USER already exists! Skipping."
fi