From 68a86acb9a8b7e4006d205ca0dc81b70167bcc6e Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 20 Jun 2011 22:56:09 +0200 Subject: retiolum/bin/install: initial commit --- retiolum/bin/install | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 retiolum/bin/install (limited to 'retiolum/bin') diff --git a/retiolum/bin/install b/retiolum/bin/install new file mode 100755 index 00000000..9e4459fb --- /dev/null +++ b/retiolum/bin/install @@ -0,0 +1,18 @@ +#! /bin/sh +# +# +# +set -euf + +trap 'echo "${comment+$comment +}You are made of stupid!">&2; exit 23' EXIT + +if ! test -e /usr/sbin/tincd; then + if grep -iq ubuntu /etc/issue; then + sudo apt-get install --yes tinc + else + comment='Install tinc to continue.' exit + fi +fi + +trap - EXIT -- cgit v1.2.3 From 2048448601aa27f993268ef67bf0eeda3625ef4e Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 12 Aug 2011 23:23:33 +0200 Subject: retiolum: go more enterprise --- retiolum/bin/update-retiolum-hosts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 retiolum/bin/update-retiolum-hosts (limited to 'retiolum/bin') diff --git a/retiolum/bin/update-retiolum-hosts b/retiolum/bin/update-retiolum-hosts new file mode 100755 index 00000000..57a8381a --- /dev/null +++ b/retiolum/bin/update-retiolum-hosts @@ -0,0 +1,11 @@ +#! /bin/sh +set -eu + +if test "${nosudo-false}" != true -a `id -u` != 0; then + echo "we're going sudo..." >&2 + exec sudo "$0" "$@" + exit 23 # go to hell +fi + +mkdir -v -p /etc/tinc/retiolum/hosts +cp -v -r hosts/* /etc/tinc/retiolum/hosts -- cgit v1.2.3 From 994d24e5614e5c5dac16cd9b9cc6c2f5a7206321 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 12 Aug 2011 23:30:44 +0200 Subject: retiolum/bin: update hosts together with tinc tincd will be forced to update it's known hosts via signals --- retiolum/bin/update-retiolum-hosts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'retiolum/bin') diff --git a/retiolum/bin/update-retiolum-hosts b/retiolum/bin/update-retiolum-hosts index 57a8381a..7b2fa0e5 100755 --- a/retiolum/bin/update-retiolum-hosts +++ b/retiolum/bin/update-retiolum-hosts @@ -9,3 +9,5 @@ fi mkdir -v -p /etc/tinc/retiolum/hosts cp -v -r hosts/* /etc/tinc/retiolum/hosts +pkill -HUP tincd +pkill -ALRM tincd -- cgit v1.2.3 From df758080d53482d0680a8eda3d5f5e1888ae091c Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 13 Aug 2011 16:18:25 +0200 Subject: check-free-retiolum-*: initial commit scripts determine if an ip-address is already taken by one of the darknet nodes this goes for the ipv6 retiolum darknet prefix, as well as internal 10.7.7.0/24 addresses --- retiolum/bin/check-free-retiolum-v4 | 22 ++++++++++++++++++++++ retiolum/bin/check-free-retiolum-v6 | 2 ++ 2 files changed, 24 insertions(+) create mode 100755 retiolum/bin/check-free-retiolum-v4 create mode 100755 retiolum/bin/check-free-retiolum-v6 (limited to 'retiolum/bin') diff --git a/retiolum/bin/check-free-retiolum-v4 b/retiolum/bin/check-free-retiolum-v4 new file mode 100755 index 00000000..e9c6b3ce --- /dev/null +++ b/retiolum/bin/check-free-retiolum-v4 @@ -0,0 +1,22 @@ +#! /bin/sh +set -x +netname=retiolum +myipv4=${1-10.7.7.-1} +v4num=${myipv4##*.} +printf "Retard check: " +if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; +then + printf "No retard detected\n" + cd /etc/tinc/$netname/hosts + printf "Check if ip is still free: " + for i in `ls -1`; do + if grep $myipv4 $i &>/dev/null ;then + echo "Host IP already taken by $i! " + exit 1 + fi + done + printf "Passed" +else + printf "you are made of stupid. bailing out\n" + exit 1 +fi diff --git a/retiolum/bin/check-free-retiolum-v6 b/retiolum/bin/check-free-retiolum-v6 new file mode 100755 index 00000000..20f87efe --- /dev/null +++ b/retiolum/bin/check-free-retiolum-v6 @@ -0,0 +1,2 @@ +#! /bin/sh +exit 0 -- cgit v1.2.3 From b56137d875f43026aeabcc4403252e5e7008b93a Mon Sep 17 00:00:00 2001 From: EUcancER Date: Tue, 23 Aug 2011 23:51:24 +0000 Subject: check-free-retiolum: fixed bug which produces wrong match --- retiolum/bin/check-free-retiolum-v4 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'retiolum/bin') diff --git a/retiolum/bin/check-free-retiolum-v4 b/retiolum/bin/check-free-retiolum-v4 index e9c6b3ce..3f0dbdf8 100755 --- a/retiolum/bin/check-free-retiolum-v4 +++ b/retiolum/bin/check-free-retiolum-v4 @@ -1,5 +1,4 @@ #! /bin/sh -set -x netname=retiolum myipv4=${1-10.7.7.-1} v4num=${myipv4##*.} @@ -10,12 +9,12 @@ then cd /etc/tinc/$netname/hosts printf "Check if ip is still free: " for i in `ls -1`; do - if grep $myipv4 $i &>/dev/null ;then + if grep -q -e $myipv4\$ $i ;then echo "Host IP already taken by $i! " exit 1 fi done - printf "Passed" + printf "Passed\n" else printf "you are made of stupid. bailing out\n" exit 1 -- cgit v1.2.3