diff options
Diffstat (limited to 'retiolum/bin')
-rwxr-xr-x | retiolum/bin/announce_pubkey | 35 | ||||
-rwxr-xr-x | retiolum/bin/check-free-retiolum-v4 | 2 | ||||
-rwxr-xr-x | retiolum/bin/create-host-tar | 15 | ||||
-rwxr-xr-x | retiolum/bin/create-supernode-tar | 13 | ||||
-rwxr-xr-x | retiolum/bin/dump-graph | 9 | ||||
l--------- | retiolum/bin/tinc_stats | 1 | ||||
l--------- | retiolum/bin/tinc_stats2json | 1 |
7 files changed, 74 insertions, 2 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 diff --git a/retiolum/bin/check-free-retiolum-v4 b/retiolum/bin/check-free-retiolum-v4 index 3f0dbdf8..3492f7f6 100755 --- a/retiolum/bin/check-free-retiolum-v4 +++ b/retiolum/bin/check-free-retiolum-v4 @@ -1,6 +1,6 @@ #! /bin/sh netname=retiolum -myipv4=${1-10.7.7.-1} +myipv4=${1-10.243.0.-1} v4num=${myipv4##*.} printf "Retard check: " if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; diff --git a/retiolum/bin/create-host-tar b/retiolum/bin/create-host-tar new file mode 100755 index 00000000..48ce26d5 --- /dev/null +++ b/retiolum/bin/create-host-tar @@ -0,0 +1,15 @@ +#!/bin/sh +set -euf +if [ x"${1:-}" = "x" ];then + echo "usage: $0 DIRECTORY" + exit 1 +fi + +WEBDIR=$1 +HOSTDIR=${HOSTDIR:-../hosts} +HOSTFILE=$WEBDIR/hosts.tar.gz + +cd $(dirname $(readlink -f $0)) +rm -f $HOSTFILE +tar czf $HOSTFILE -C $HOSTDIR . +chmod a+rx $HOSTFILE diff --git a/retiolum/bin/create-supernode-tar b/retiolum/bin/create-supernode-tar new file mode 100755 index 00000000..322d428d --- /dev/null +++ b/retiolum/bin/create-supernode-tar @@ -0,0 +1,13 @@ +#!/bin/sh +set -euf +if [ x"${1:-}" = "x" ];then + echo "usage: $0 DIRECTORY" + exit 1 +fi +HOSTDIR=${HOSTDIR:-../hosts} +WEBDIR=$1 +HOSTFILE=$WEBDIR/supernodes.tar.gz +cd $(dirname $(readlink -f $0)) +rm -f $HOSTFILE +tar czf $HOSTFILE -C $HOSTDIR `python ../scripts/adv_graphgen/find_super.py |cut -d\ -f1` +chmod a+rx $HOSTFILE diff --git a/retiolum/bin/dump-graph b/retiolum/bin/dump-graph new file mode 100755 index 00000000..87539f49 --- /dev/null +++ b/retiolum/bin/dump-graph @@ -0,0 +1,9 @@ +#! /bin/sh +set -euf + +t0="`date '+%Y-%m-%d %H:%M:%S'`" +systemctl kill --signal=USR2 tincd@retiolum +sleep 5 +journalctl --since="$t0" | sed -n ' + s/.*tinc\.retiolum\[[0-9]\+\]: \([^ ]\+\) to \([^ ]\+\) at \([^ ]\+\) .*$/\1 \2 \3/p +' diff --git a/retiolum/bin/tinc_stats b/retiolum/bin/tinc_stats deleted file mode 120000 index 6a58af60..00000000 --- a/retiolum/bin/tinc_stats +++ /dev/null @@ -1 +0,0 @@ -/home/makefu/repos/krebs/retiolum/scripts/adv_graphgen/tinc_stats.py
\ No newline at end of file diff --git a/retiolum/bin/tinc_stats2json b/retiolum/bin/tinc_stats2json new file mode 120000 index 00000000..413b778c --- /dev/null +++ b/retiolum/bin/tinc_stats2json @@ -0,0 +1 @@ +../scripts/adv_graphgen/tinc_stats2json
\ No newline at end of file |