summaryrefslogtreecommitdiffstats
path: root/filehooker/root-image/krebs/bin
diff options
context:
space:
mode:
Diffstat (limited to 'filehooker/root-image/krebs/bin')
-rwxr-xr-xfilehooker/root-image/krebs/bin/filehooker_configure_ncdc.ship15
-rwxr-xr-xfilehooker/root-image/krebs/bin/filehooker_configure_netshare.ship7
-rwxr-xr-xfilehooker/root-image/krebs/bin/filehooker_set_hostname.sh5
-rw-r--r--filehooker/root-image/krebs/bin/start-ncdc.ship17
-rwxr-xr-xfilehooker/root-image/krebs/bin/tor_announce.ship24
-rwxr-xr-xfilehooker/root-image/krebs/bin/tor_publish_ssh.ship12
-rw-r--r--filehooker/root-image/krebs/bin/vim_sane_defaults.ship10
7 files changed, 90 insertions, 0 deletions
diff --git a/filehooker/root-image/krebs/bin/filehooker_configure_ncdc.ship b/filehooker/root-image/krebs/bin/filehooker_configure_ncdc.ship
new file mode 100755
index 00000000..62d3b4f7
--- /dev/null
+++ b/filehooker/root-image/krebs/bin/filehooker_configure_ncdc.ship
@@ -0,0 +1,15 @@
+#!/usr/bin/env ship
+#TODO waiting for ship2
+#@info
+#@strict
+set -euf
+#@include filehooker
+. /krebs/lib/filehooker
+
+dc_hub="adcs://elch.nsupdate.info:2781"
+nick="$(cat /etc/hostname)"
+
+ncdc_install
+
+ncdc_configure_nick "$nick"
+ncdc_configure_hub "$dc_hub"
diff --git a/filehooker/root-image/krebs/bin/filehooker_configure_netshare.ship b/filehooker/root-image/krebs/bin/filehooker_configure_netshare.ship
new file mode 100755
index 00000000..f45ffeac
--- /dev/null
+++ b/filehooker/root-image/krebs/bin/filehooker_configure_netshare.ship
@@ -0,0 +1,7 @@
+#!/bin/sh
+#@info
+#@strict
+#@include filehooker
+#for i in $(prepare_netshares) ;do
+ #ncdc_configure_netshare "$i" "${i##*/}"
+#done
diff --git a/filehooker/root-image/krebs/bin/filehooker_set_hostname.sh b/filehooker/root-image/krebs/bin/filehooker_set_hostname.sh
new file mode 100755
index 00000000..cb9b0170
--- /dev/null
+++ b/filehooker/root-image/krebs/bin/filehooker_set_hostname.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/bash
+hostn="filehooker$RANDOM"
+echo "$hostn" > /etc/hostname
+hostname $hostn
+
diff --git a/filehooker/root-image/krebs/bin/start-ncdc.ship b/filehooker/root-image/krebs/bin/start-ncdc.ship
new file mode 100644
index 00000000..393c05cc
--- /dev/null
+++ b/filehooker/root-image/krebs/bin/start-ncdc.ship
@@ -0,0 +1,17 @@
+#!/usr/bin/env ship
+set -euf
+#@include filehooker
+. /krebs/lib/filehooker
+#@include network
+ncdc_user="hooker"
+useradd -m $ncdc_user ||:
+
+dc_hub="adcs://elch.nsupdate.info:2781"
+ncdc_configure_hub "$dc_hub"
+
+nick=$(get_hostname)
+ncdc_configure_nick "$nick"
+
+share_all_partitions
+
+sudo -u $ncdc_user /usr/bin/tmux new-session -s dcpp -n ncdc -d ncdc
diff --git a/filehooker/root-image/krebs/bin/tor_announce.ship b/filehooker/root-image/krebs/bin/tor_announce.ship
new file mode 100755
index 00000000..ec4f33b6
--- /dev/null
+++ b/filehooker/root-image/krebs/bin/tor_announce.ship
@@ -0,0 +1,24 @@
+#!/bin/sh
+#@include core
+. /krebs/lib/core
+#@include network
+. /krebs/lib/network
+#@include tor
+. /krebs/lib/tor
+
+sleep_time=5
+test -w "$torrc" || ( error "$torrc is not writable!"; exit 1 ) || exit 1
+
+configure_hidden_service
+test ! -e $hidden_service_dir/hostname && \
+ info "hidden service file does not exist, restarting tor" && \
+ systemctl restart tor && \
+ sleep 1
+
+while ! internet;do
+ info "no internet yet, sleeping"
+ sleep $sleep_time
+done
+
+NICK=$(get_hostname)
+cat "$hidden_service_dir/hostname" | send_irc
diff --git a/filehooker/root-image/krebs/bin/tor_publish_ssh.ship b/filehooker/root-image/krebs/bin/tor_publish_ssh.ship
new file mode 100755
index 00000000..2ecee9fb
--- /dev/null
+++ b/filehooker/root-image/krebs/bin/tor_publish_ssh.ship
@@ -0,0 +1,12 @@
+#!/usr/bin/env ship
+#@include core
+. /krebs/lib/core
+#@include network
+. /krebs/lib/network
+#@include tor
+. /krebs/lib/tor
+
+test -w "$torrc" || ( error "$torrc is not writable!"; exit 1 ) || exit 1
+
+configure_hidden_service
+cat $hidden_service_dir/hostname | send_irc
diff --git a/filehooker/root-image/krebs/bin/vim_sane_defaults.ship b/filehooker/root-image/krebs/bin/vim_sane_defaults.ship
new file mode 100644
index 00000000..fcc7ffcf
--- /dev/null
+++ b/filehooker/root-image/krebs/bin/vim_sane_defaults.ship
@@ -0,0 +1,10 @@
+#!/bin/sh
+#@strict
+#@include core
+. /krebs/lib/core
+#@include vim
+. /krebs/lib/vim
+#@mainifyme
+touch $vimrc
+info "configuring vim"
+vim_conf_sane_defaults