aboutsummaryrefslogtreecommitdiff
path: root/deps/torconf.sh
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2020-05-24 16:48:22 +0200
committerToni Uhlig <matzeton@googlemail.com>2020-05-25 21:57:14 +0200
commit31c69b6ca1b91e7fd9fd8e14082fd2584c5f538c (patch)
tree16e789c7d68608831b498f41f54d9482b82a711a /deps/torconf.sh
first public release
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'deps/torconf.sh')
-rwxr-xr-xdeps/torconf.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/deps/torconf.sh b/deps/torconf.sh
new file mode 100755
index 0000000..4de1e97
--- /dev/null
+++ b/deps/torconf.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+set -e
+
+
+. "$(dirname $0)/config.sh"
+TOR_CONF="${MY_SYS_ROOT}/etc/tor/torrc"
+
+
+if [ ! -r ${TOR_CONF} ]; then
+ if [ ! -r ${TOR_CONF}.sample ]; then
+ echo "$0: Run $(dirname $0)/makedeps.sh first !" >&2
+ fi
+
+ set -x
+ cp ${TOR_CONF}.sample ${TOR_CONF}
+
+ sed -i 's/^\(#SOCKSPort\(.*\)address:port\(.*\)\)$/\1\nSOCKSPort 0/' ${TOR_CONF}
+ sed -i 's/^#SOCKSPolicy reject \*/#SOCKSPolicy reject \*\nSOCKSPolicy accept 127.0.0.1\/32\nSOCKSPolicy reject \*/' ${TOR_CONF}
+ sed -i 's/^#Log debug stderr/#Log debug stderr\nLog notice stderr/' ${TOR_CONF}
+ sed -i 's/^#DataDirectory/DataDirectory/' ${TOR_CONF}
+ sed -i 's/^#RunAsDaemon 1/RunAsDaemon 0/' ${TOR_CONF}
+ sed -i 's/^#HiddenServiceDir\(.*\)\/hidden_service\/$/HiddenServiceDir\1\/hidden_service\/\nHiddenServicePort 80 127.0.0.1:8080/' ${TOR_CONF}
+
+ mkdir -p "${MY_SYS_ROOT}/var/lib/tor"
+else
+ echo "$0: ${TOR_CONF} does already exist !" >&2
+fi