From a87fa79e491911ebbf13697879286300c255f13e Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Tue, 10 May 2011 21:05:33 +0200 Subject: migrate to new repo layout README: added new clean install script description build_debian.sh: updated build_debian script (might still be broken) install.sh: updated script to work with new layout (untested) --- retiolum/hosts/.scripts/README | 15 ++++++ retiolum/hosts/.scripts/build_arch.sh | 14 ++++++ retiolum/hosts/.scripts/build_debian.sh | 18 +++++++ retiolum/hosts/.scripts/build_debian_clean.sh | 31 ++++++++++++ retiolum/hosts/.scripts/build_ec2.sh | 16 +++++++ retiolum/hosts/.scripts/build_no.de.sh | 1 + retiolum/hosts/.scripts/install.sh | 68 +++++++++++++++++++++++++++ 7 files changed, 163 insertions(+) create mode 100644 retiolum/hosts/.scripts/README create mode 100755 retiolum/hosts/.scripts/build_arch.sh create mode 100755 retiolum/hosts/.scripts/build_debian.sh create mode 100755 retiolum/hosts/.scripts/build_debian_clean.sh create mode 100755 retiolum/hosts/.scripts/build_ec2.sh create mode 100644 retiolum/hosts/.scripts/build_no.de.sh create mode 100755 retiolum/hosts/.scripts/install.sh (limited to 'retiolum/hosts/.scripts') diff --git a/retiolum/hosts/.scripts/README b/retiolum/hosts/.scripts/README new file mode 100644 index 00000000..8d104179 --- /dev/null +++ b/retiolum/hosts/.scripts/README @@ -0,0 +1,15 @@ +This directory contains the build and install scripts for shack-retiolum + +1. build_arch + arch linux build script +2. build_debian + debian build script +3. build_debian_clean + debian script which builds a clean tinc daemon +4. build_ec2 + Amazon ec2 base instance build script +5. install.sh + configures the tinc daemon + $1 is the nickname + $2 is the ip-address +hosts.tar contains the currently available hosts diff --git a/retiolum/hosts/.scripts/build_arch.sh b/retiolum/hosts/.scripts/build_arch.sh new file mode 100755 index 00000000..5ef5d765 --- /dev/null +++ b/retiolum/hosts/.scripts/build_arch.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e +sudo pacman -S openssl gcc lzo +curl http://www.tinc-vpn.org/packages/tinc-1.0.13.tar.gz | tar xz +cd tinc-1.0.13 +./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var +make +sudo make install +cd .. + +echo "overwriting python to python2" +sed 's/\/usr\/bin\/python/\/usr\/bin\/python2/g' install.sh >install2.sh +mv install2.sh install.sh + diff --git a/retiolum/hosts/.scripts/build_debian.sh b/retiolum/hosts/.scripts/build_debian.sh new file mode 100755 index 00000000..d8fcec2f --- /dev/null +++ b/retiolum/hosts/.scripts/build_debian.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -x +MYIP=10.0.7.7.55 + +apt-get install tinc git curl python + +git clone https://github.com/makefu/shack-retiolum.git + +cd shack-retiolum + +./install.sh `hostname` $MYIP +cd .. +rm shack-retiolum +# for autostart +sed -i '/retiolum/d' /etc/tinc/nets.boot +echo "retiolum" >> /etc/tinc/nets.boot +sed -i '/EXTRA/d' /etc/tinc/nets.boot +echo "EXTRA=\"\"" >> /etc/default/tinc diff --git a/retiolum/hosts/.scripts/build_debian_clean.sh b/retiolum/hosts/.scripts/build_debian_clean.sh new file mode 100755 index 00000000..a7332f4e --- /dev/null +++ b/retiolum/hosts/.scripts/build_debian_clean.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -xe +MYIP=10.0.7.7.55 + +apt-get install tinc git curl gcc gcc-dev build-essential libssl-dev python + +git clone https://github.com/makefu/shack-retiolum.git + +mkdir build +cd build +curl http://www.oberhumer.com/opensource/lzo/download/lzo-2.04.tar.gz | tar +xz +cd lzo-2.04 +./configure --prefix=/usr +make +sudo make install +cd .. +curl http://www.tinc-vpn.org/packages/tinc-1.0.13.tar.gz | tar xz +cd tinc-1.0.13 +./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var +make +sudo make install +cd ../.. + +cd shack-retiolum +./install.sh `hostname` $MYIP + +rm shack-retiolum +# for autostart +echo "retiolum" >> /etc/tinc/nets.boot +echo "EXTRA=\"--user=tincd --chroot\"" >> /etc/default/tinc diff --git a/retiolum/hosts/.scripts/build_ec2.sh b/retiolum/hosts/.scripts/build_ec2.sh new file mode 100755 index 00000000..79f2af28 --- /dev/null +++ b/retiolum/hosts/.scripts/build_ec2.sh @@ -0,0 +1,16 @@ +#!/bin/sh +set -e +sudo yum install -y gcc openssl-devel +mkdir build +cd build +curl http://www.oberhumer.com/opensource/lzo/download/lzo-2.04.tar.gz | tar xz +cd lzo-2.04 +./configure --prefix=/usr +make +sudo make install +cd .. +curl http://www.tinc-vpn.org/packages/tinc-1.0.13.tar.gz | tar xz +cd tinc-1.0.13 +./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var +make +sudo make install diff --git a/retiolum/hosts/.scripts/build_no.de.sh b/retiolum/hosts/.scripts/build_no.de.sh new file mode 100644 index 00000000..2976d3a2 --- /dev/null +++ b/retiolum/hosts/.scripts/build_no.de.sh @@ -0,0 +1 @@ +pkgin in lzo gcc-tools gcc-compiler gcc34 diff --git a/retiolum/hosts/.scripts/install.sh b/retiolum/hosts/.scripts/install.sh new file mode 100755 index 00000000..4b21bcd4 --- /dev/null +++ b/retiolum/hosts/.scripts/install.sh @@ -0,0 +1,68 @@ +#! /bin/sh +# USE WITH GREAT CAUTION + +set -e +myname="${1:-dummy}" +rel_hostsfile=`dirname $0`/.. +hostsfile=`readlink -f $rel_hostsfile` +netname=retiolum +myipv4="${2:-10.7.7.56}" +mynet4=10.7.7.0 +CURR=`pwd` +# create configuration directory for $netname +mkdir -p /etc/tinc/$netname +cd /etc/tinc/$netname + +# get currently known hosts +cp -r $hostsfile hosts +echo "added known hosts:" +ls -1 | LC_ALL=C sort +echo "delete the nodes you do not trust!" + + +cat>tinc-up<tinc.conf< hosts/$myname +tincd -n $netname -K + +echo Writing Public Key to irc channel +cat>write_channel.py<