summaryrefslogtreecommitdiff
path: root/tor
diff options
context:
space:
mode:
authorDanny Rawlins <romster@shortcircuit.net.au>2008-01-18 13:21:04 +1100
committerDanny Rawlins <romster@shortcircuit.net.au>2008-01-18 13:21:04 +1100
commit99056c3d0952ea411a4cef20ae45b23f9e7b4f10 (patch)
tree884347613e1b762ac83a5601e72572ce6077b967 /tor
parentae3f82a8c2883882c244d6168b8f8945809139f8 (diff)
downloadcontrib-99056c3d0952ea411a4cef20ae45b23f9e7b4f10.tar.gz
contrib-99056c3d0952ea411a4cef20ae45b23f9e7b4f10.tar.xz
tor: 0.1.2.18 -> 0.1.2.19
Diffstat (limited to 'tor')
-rw-r--r--tor/.md5sum2
-rw-r--r--tor/Pkgfile2
-rw-r--r--tor/README8
-rwxr-xr-x[-rw-r--r--]tor/pre-install44
4 files changed, 32 insertions, 24 deletions
diff --git a/tor/.md5sum b/tor/.md5sum
index 6ee878bba..d4cd0eeac 100644
--- a/tor/.md5sum
+++ b/tor/.md5sum
@@ -1,2 +1,2 @@
-6cfe65643f3874a9709f0c19e7c648e0 tor-0.1.2.18.tar.gz
+4b3f9963b843010af5aa3bd6266d11e0 tor-0.1.2.19.tar.gz
128bcc0a2ae7a3a6fa86935cabeb9a4b tor.rc
diff --git a/tor/Pkgfile b/tor/Pkgfile
index 7a77618cf..c8adb5186 100644
--- a/tor/Pkgfile
+++ b/tor/Pkgfile
@@ -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)
diff --git a/tor/README b/tor/README
index 3812db7a9..4b611dfe9 100644
--- a/tor/README
+++ b/tor/README
@@ -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
diff --git a/tor/pre-install b/tor/pre-install
index e4b902309..b89114fb1 100644..100755
--- a/tor/pre-install
+++ b/tor/pre-install
@@ -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."
+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 ! 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."
+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 "User: $USER already exists! Skipping."
+ echo "ERROR: unable to lock $USER account."
+ /usr/sbin/userdel $USER
+ fi
+ else
+ echo "User: $USER already exists! Skipping."
fi

Generated by cgit