diff options
author | Lassulus <lassulus@googlemail.com> | 2012-12-09 16:29:26 +0100 |
---|---|---|
committer | Lassulus <lassulus@googlemail.com> | 2012-12-09 16:29:26 +0100 |
commit | 8e36e9942498b821ed3825d5f3b631e27aa4d265 (patch) | |
tree | 56a1008fb88e0242297245c75928f265a12b10c2 /retiolum/scripts/tinc_setup/new_install.sh | |
parent | 85af484348ac6ad8ca6b9bf992ecf8b63b4ec587 (diff) |
now working
Diffstat (limited to 'retiolum/scripts/tinc_setup/new_install.sh')
-rwxr-xr-x | retiolum/scripts/tinc_setup/new_install.sh | 24 |
1 files changed, 19 insertions, 5 deletions
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 |