diff options
author | makefu <github@syntax-fehler.de> | 2014-03-17 07:51:03 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2014-03-17 07:51:03 +0100 |
commit | 1fa15dd59e7dc58f4331305b9f401d3aabfa53cd (patch) | |
tree | 6e4ee2f1096652276b86f4b9334fa06aafdb38bf /filehooker/root-image/krebs/lib/tor | |
parent | 536bfe6d1e3cce27b6a84d4c19f7feafac690b53 (diff) |
filehooker: initial commit
using archiso magic scripts
Diffstat (limited to 'filehooker/root-image/krebs/lib/tor')
-rw-r--r-- | filehooker/root-image/krebs/lib/tor | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/filehooker/root-image/krebs/lib/tor b/filehooker/root-image/krebs/lib/tor new file mode 100644 index 00000000..8d9e33f1 --- /dev/null +++ b/filehooker/root-image/krebs/lib/tor @@ -0,0 +1,19 @@ +# 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/} + +configure_hidden_service(){ + 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 +} |