From 8e36e9942498b821ed3825d5f3b631e27aa4d265 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Sun, 9 Dec 2012 16:29:26 +0100 Subject: now working --- retiolum/scripts/tinc_setup/new_install.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'retiolum') diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 52bb4ddb..dcbb2670 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -116,6 +116,10 @@ RAND6=1 URL=euer.krebsco.de/retiolum/hosts.tar.gz OS=0 +IRCCHANNEL="#krebsco" +IRCSERVER="irc.freenode.net" +IRCPORT=6667 + #check if everything is installed if ! which tincd&>/dev/null; then echo "Please install tinc" @@ -307,15 +311,25 @@ else echo "route add -net $FULLSUBNET netmask $RETARDEDMASK dev $INTERFACE " >> tinc-up fi +#fix permissions chmod +x tinc-up chown -R root:root . +#generate keys with tinc if which tincctl&>/dev/null; then - + yes | tincctl -n $NETNAME generate-keys + cat rsa_key.pub >> hosts/$HOSTN +else + yes | tincd -n $NETNAME -K fi -echo "your ipv4 is $IP4" -echo "your ipv6 is $IP6" -echo "your hostname is $HOSTN" -echo "your OS is $OS" +#write to irc-channel +NICK="${HOSTN}_$((RANDOM%666))" + +( echo "NICK $NICK"; + echo "USER $NICK $IRCSERVER bla : $NICK"; + echo "JOIN $IRCCHANNEL"; + sleep 23; + sed "s/^\(.*\)/PRIVMSG $IRCCHANNEL : \1/" hosts/$HOSTN; + sleep 5; ) | telnet $IRCSERVER $IRCPORT -- cgit v1.2.3