summaryrefslogtreecommitdiffstats
path: root/retiolum/bin
diff options
context:
space:
mode:
authoreuer <root@euer.krebsco.de>2012-12-07 22:53:52 +0100
committereuer <root@euer.krebsco.de>2012-12-07 22:53:52 +0100
commitd263d0e9e7e6c37f793eb3ec1908d188849f5d02 (patch)
tree1636d12349ebb4c3ff16ec755771fccb1e46f823 /retiolum/bin
parentd3d49099cbe570dee7f6cbfab2723bc04d81ac79 (diff)
parent253f0a908b190f0ff6d2f71023d050c088533c02 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'retiolum/bin')
-rwxr-xr-xretiolum/bin/announce_pubkey35
1 files changed, 35 insertions, 0 deletions
diff --git a/retiolum/bin/announce_pubkey b/retiolum/bin/announce_pubkey
new file mode 100755
index 00000000..ce5aed19
--- /dev/null
+++ b/retiolum/bin/announce_pubkey
@@ -0,0 +1,35 @@
+#!/bin/sh
+set -euf
+HOST="${1:-}"
+
+usage (){
+cat <<EOF
+usage: $0 HOSTNAME
+
+also, you are made of stupid
+EOF
+exit 23
+}
+
+[ "x$HOST" = "x" ] && usage
+
+CHANNEL="#krebsco"
+IRCHOST="irc.freenode.net"
+PORT=6667
+RETIOLUM="/etc/tinc/retiolum"
+PUBFILE="$RETIOLUM/hosts/$HOST"
+
+if [ ! -e $PUBFILE ] ;then
+ echo "cannot find $PUBFILE - host $HOST wrong?" ;
+ echo
+ usage
+fi
+
+NICK="${HOST}_$((RANDOM%666))"
+
+( echo "NICK $NICK";
+ echo "USER $NICK $IRCHOST bla : $NICK";
+ echo "JOIN $CHANNEL";
+ sleep 23;
+ sed "s/^\(.*\)/PRIVMSG $CHANNEL : \1/" $PUBFILE;
+ sleep 5; ) | telnet $IRCHOST $PORT