summaryrefslogtreecommitdiff
path: root/network/tor/doinst.sh
diff options
context:
space:
mode:
authorErik Hanson <erik@slackbuilds.org>2010-05-11 15:01:37 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-11 15:01:37 +0200
commit38ee9adc8bed3fd9d3d4d2328fb0639b3002935f (patch)
tree8b0de1124feb7decb0c7271dc76f6471fc25c85b /network/tor/doinst.sh
parent7d81370b4d67036e1696db79a2ee9b8b28295e5f (diff)
downloadslackbuilds-38ee9adc8bed3fd9d3d4d2328fb0639b3002935f.tar.gz
network/tor: Initial import
Diffstat (limited to 'network/tor/doinst.sh')
-rw-r--r--network/tor/doinst.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/network/tor/doinst.sh b/network/tor/doinst.sh
new file mode 100644
index 0000000000..4a7f53f556
--- /dev/null
+++ b/network/tor/doinst.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+config() {
+ NEW="$1"
+ OLD="`dirname $NEW`/`basename $NEW .new`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+# Keep same perms on rc.tor.new:
+if [ -e etc/rc.d/rc.tor ]; then
+ cp -a etc/rc.d/rc.tor etc/rc.d/rc.tor.new.incoming
+ cat etc/rc.d/rc.tor.new > etc/rc.d/rc.tor.new.incoming
+ mv etc/rc.d/rc.tor.new.incoming etc/rc.d/rc.tor.new
+fi
+
+config etc/rc.d/rc.tor.new
+config etc/tor/tor-tsocks.conf.new