summaryrefslogtreecommitdiffstats
path: root/ship/lib/filehooker
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2014-03-16 15:01:22 +0100
committermakefu <root@pigstarter.de>2014-03-16 15:01:22 +0100
commitc503a92fd711a73762a44ea08cf10438ed03fa55 (patch)
treecc9c5f345ad2497563cc9f1b5552d7e09e2c9276 /ship/lib/filehooker
parentd40950a555d594365307fca7a5a23a360a15645c (diff)
parente2cf4fc92569487e21d096ac6879177aac8f73c1 (diff)
filehooker: add tor_announce
Diffstat (limited to 'ship/lib/filehooker')
-rw-r--r--ship/lib/filehooker25
1 files changed, 25 insertions, 0 deletions
diff --git a/ship/lib/filehooker b/ship/lib/filehooker
index a2fba840..3c881f91 100644
--- a/ship/lib/filehooker
+++ b/ship/lib/filehooker
@@ -1,4 +1,5 @@
#@include core
+#@include network
ncdc_user=${ncdc_user:-hooker}
ncdc_bin=${ncdc_bin:-/usr/bin/ncdc}
@@ -90,3 +91,27 @@ prepare_netshares(){
fi
done
}
+install_tor_announce(){
+# systemd only
+info "writing tor_announce.service"
+cat > /etc/systemd/system/tor_announce.service<<EOF
+[Unit]
+Description=Announce Tor Hidden Address
+After=network.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/tor_announce
+
+[Install]
+WantedBy=multi-user.target
+EOF
+info "writing tor_announce to /usr/bin/tor_announce"
+printf '#!/bin/sh\nsleep 20\n' > /usr/bin/tor_announce
+http_get conf.krebsco.de/tor_publish_ssh >> /usr/bin/tor_announce
+chmod +x /usr/bin/tor_announce
+info "enable tor_announce"
+systemctl enable tor_announce
+#systemctl start tor_announce
+}