summaryrefslogtreecommitdiffstats
path: root/ship/src/tor
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-11-07 17:01:43 +0100
committermakefu <github@syntax-fehler.de>2013-11-07 17:01:43 +0100
commit488ece5a43b8811d470c506ccfb278186462c15f (patch)
tree488b8cad1e73fcc3e3e645120f20384db7f65328 /ship/src/tor
parentf77fa1e08c288a8343e313c3dca373deae8b83f2 (diff)
add tor-installer
Diffstat (limited to 'ship/src/tor')
-rwxr-xr-xship/src/tor23
1 files changed, 23 insertions, 0 deletions
diff --git a/ship/src/tor b/ship/src/tor
new file mode 100755
index 00000000..fa0c929f
--- /dev/null
+++ b/ship/src/tor
@@ -0,0 +1,23 @@
+#!/bin/sh
+#@include core
+
+
+# can be set via env:
+# torrc - path to torrc (default: /etc/tor/torrc )
+# hidden_service_dir - path to hidden service (default: /var/lib/tor/hidden_service/ )
+
+torrc=${torrc:-/etc/tor/torrc}
+hidden_service_dir=${hidden_service_dir:-/var/lib/tor/hidden_service/}
+
+test -w "$torrc" || ( error "$torrc is not writable!"; exit 1 )
+if ! grep -q '^HiddenService' "$torrc" ;then
+ info "adding hidden service to $torrc"
+ cat >> "$torrc" << EOF
+HiddenServiceDir ${hidden_service_dir}
+HiddenServicePort 22 127.0.0.1:22
+EOF
+else
+ info "HiddenServiceDir or Port already in $torrc, skipping!"
+fi
+
+cat $hidden_service_dir/hostname | send_irc