diff options
Diffstat (limited to 'retiolum')
-rw-r--r-- | retiolum/hosts/cloudkrebs | 12 | ||||
-rw-r--r-- | retiolum/hosts/serenity | 11 | ||||
-rwxr-xr-x | retiolum/scripts/tinc_setup/propagate-config | 61 |
3 files changed, 78 insertions, 6 deletions
diff --git a/retiolum/hosts/cloudkrebs b/retiolum/hosts/cloudkrebs index a6783d0b..43d35d1f 100644 --- a/retiolum/hosts/cloudkrebs +++ b/retiolum/hosts/cloudkrebs @@ -3,10 +3,10 @@ Subnet = 10.243.206.102 Subnet = 42:941e:2816:35f4:5c5e:206b:3f0b:f762 -----BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAoXp4UXctvHQRiJps4CzURNBsZE8mC8emtXK6pjfq73Pg4R94ayx4 -+JtgEFY+VZeNIKHlaAqfNm8+RfHS7AFgMkiA4WBK2PI8Vpj64wUHz+EcySIInIdx -9J00KRUYA9w8pC8qxjZlxsFlDb4i/kzk1Qt4izV++itzICRolHcuHCeWN3ceok1O -gckSSi+zSyGiukRlIHqFkHRCJzt2LV06BV+8ARvLBsF/N9imfVxlfNpEcJCjwgFY -E5kcr7HpywYA3myphmvrGTPV/xy0m1tfNsWNMWXdk75K2Pl8h3h8b2ViHgcWjmNY -jDeTVvaoGgFRzfu+3cA1TiHwDcQKKZodBQIDAQAB +MIIBCgKCAQEA33RbuP2zPuZx/fakOsekIJPln4AKsIVYT5nt+Xk1y8MiIX2y3NAj +ovmWMJF1hxHyInA+FuInOWH6fgxF7Slluz8dNdtciaACZDOQv0NWMliukYKoYYGP +qFc8TEQPknmQpWW25naaT9m/69iQ3mxUm/IncxxyFxgtWfrlLvUqF0h57iEDZUZi +EXf0lE1iYXNZlGB9ZOS0+s9Y3uQIBNJWCGyup5b3S0aUKnIkCrZ9zMVAQoipXIWb +ANBIQe0fp9hbhS//TslTGnVEoBW3cFEdrvAyZKdcuu4wF/hOvuFGMz41hORPjLZd +Mk57k0Xt9IlcvVdXq+FYZ1Bt727HCAgJFwIDAQAB -----END RSA PUBLIC KEY----- diff --git a/retiolum/hosts/serenity b/retiolum/hosts/serenity new file mode 100644 index 00000000..09c519a0 --- /dev/null +++ b/retiolum/hosts/serenity @@ -0,0 +1,11 @@ +Subnet = 10.243.137.182 +Subnet = 42:7538:6f17:220f:bcc0:2d2d:d6f6:911f + +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEAvVxASw+8nrkQisvliqjYXASQ8O0v4KGlQDHQWx4eBKOfPyQbgJpU +LOF1nikZTz56SyJAwZY1r7JXpvzycWKXkLK/deqJrHkm83lRbwbzKrExzW8hNaVD +nO+P4X19uG/gcfxc9+CdPbHxtUPCNQKUhtYfnXrzTu9jiz7WibkJRYMvY1bd4SK1 +rkKGwIfQiWGvA2cLyWZH2XnFptl0YVHulGnIIVp/bvTuPDsba4mTWeuJhi+16ZzP +PwsR5taxB+dxygESp+kwu00Xmwv5MnmL6QWDlTHYZX19FXkeAV+sHxEO0K4YLFQn +pucTzUBNiZX68HF3R5SdH7wsg9jsvE8c3wIDAQAB +-----END RSA PUBLIC KEY----- diff --git a/retiolum/scripts/tinc_setup/propagate-config b/retiolum/scripts/tinc_setup/propagate-config new file mode 100755 index 00000000..27a9880a --- /dev/null +++ b/retiolum/scripts/tinc_setup/propagate-config @@ -0,0 +1,61 @@ +#!/bin/sh -x +set -euf + +main() { + + if [ $# -ne 1 ]; then + usage + exit 1 + fi + + TINCDIR=$1 + + HOSTN=$(cat $TINCDIR/tinc.conf | awk '/Name ?=/ {gsub(/Name ?= ?/, ""); print}') + NICK="${HOSTN}_$(head /dev/urandom | tr -dc "0123456789" | head -c3)" + + IRCCHANNEL=${IRCCHANNEL:-"#krebs_incoming"} + IRCSERVER=${IRCSERVER:-"irc.freenode.net"} + IRCPORT=${IRCPORT:-6667} + + test -z ${HOSTSDIR+x} && find_hostdir + + test -z ${TELNET+x} && find_telnet + + ( echo "NICK $NICK"; + echo "USER $NICK $IRCSERVER bla : $NICK"; + echo "JOIN $IRCCHANNEL"; + sleep 23; + echo "PRIVMSG $IRCCHANNEL : This is $HOSTN"; + sed "s/^\(.*\)/PRIVMSG $IRCCHANNEL : \1/" $HOSTSDIR/$HOSTN; + sleep 5; ) | $TELNET $IRCSERVER $IRCPORT +} + +exists() { + type "$1" >/dev/null 2>/dev/null; +} + +find_hostdir() { + if [ -e "$TINCDIR/hosts" ]; then + HOSTSDIR="$TINCDIR/hosts" + else + echo 'cannot find hostsdir of tinc, please specify with HOSTSDIR=...' + exit 1 + fi +} + +find_telnet() { + if exists telnet >/dev/null; then + TELNET=$(command -v telnet) + else + echo "cannot find telnet binary, please install telnet-client" + echo "bailing out!" + exit 1 + fi +} + +usage() { + echo './propagate-config $TINCDIR' + echo 'If the hosts dir is not in $TINC_DIR you have to specify it using HOSTSDIR=$path_to_hostsdir ./propagate $TINCDIR.' +} + +main "$@" |