From 004afecb81c443a4ab459cfd7f4468ad692f6dd7 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 17 Mar 2014 09:27:05 +0100 Subject: add ncdc startup script --- filehooker/root-image/krebs/bin/start-ncdc.ship | 17 +++++++++++++++++ filehooker/root-image/krebs/bin/tor_announce.ship | 9 ++++++++- filehooker/root-image/krebs/bin/vim_sane_defaults | 10 ---------- filehooker/root-image/krebs/bin/vim_sane_defaults.ship | 10 ++++++++++ 4 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 filehooker/root-image/krebs/bin/start-ncdc.ship delete mode 100644 filehooker/root-image/krebs/bin/vim_sane_defaults create mode 100644 filehooker/root-image/krebs/bin/vim_sane_defaults.ship (limited to 'filehooker/root-image/krebs/bin') 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 index bf9d58dc..ec4f33b6 100755 --- a/filehooker/root-image/krebs/bin/tor_announce.ship +++ b/filehooker/root-image/krebs/bin/tor_announce.ship @@ -6,6 +6,7 @@ #@include tor . /krebs/lib/tor +sleep_time=5 test -w "$torrc" || ( error "$torrc is not writable!"; exit 1 ) || exit 1 configure_hidden_service @@ -14,4 +15,10 @@ test ! -e $hidden_service_dir/hostname && \ systemctl restart tor && \ sleep 1 -cat $hidden_service_dir/hostname | send_irc +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/vim_sane_defaults b/filehooker/root-image/krebs/bin/vim_sane_defaults deleted file mode 100644 index fcc7ffcf..00000000 --- a/filehooker/root-image/krebs/bin/vim_sane_defaults +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -#@strict -#@include core -. /krebs/lib/core -#@include vim -. /krebs/lib/vim -#@mainifyme -touch $vimrc -info "configuring vim" -vim_conf_sane_defaults 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 -- cgit v1.2.3