From 9210cdcdd8f9b7cf1bc48dcc01914b1d2530820d Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 7 Nov 2013 17:14:13 +0100 Subject: ship: tor -> tor_publish_ssh --- ship/src/tor | 25 ------------------------- ship/src/tor_publish_ssh | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) delete mode 100755 ship/src/tor create mode 100755 ship/src/tor_publish_ssh (limited to 'ship') diff --git a/ship/src/tor b/ship/src/tor deleted file mode 100755 index df904444..00000000 --- a/ship/src/tor +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -#@include core -#@include network -#@include punani -# 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/} - -punani install tor - -test -w "$torrc" || ( error "$torrc is not writable!"; exit 1 ) || 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 diff --git a/ship/src/tor_publish_ssh b/ship/src/tor_publish_ssh new file mode 100755 index 00000000..df904444 --- /dev/null +++ b/ship/src/tor_publish_ssh @@ -0,0 +1,25 @@ +#!/bin/sh +#@include core +#@include network +#@include punani +# 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/} + +punani install tor + +test -w "$torrc" || ( error "$torrc is not writable!"; exit 1 ) || 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 -- cgit v1.2.3