diff options
-rw-r--r-- | cholerab/AGENDA.cccamp11 | 18 | ||||
-rwxr-xr-x | retiolum/bin/check-free-retiolum-v4 | 22 | ||||
-rwxr-xr-x | retiolum/bin/check-free-retiolum-v6 | 2 | ||||
-rwxr-xr-x | retiolum/scripts/tinc_setup/install.sh | 13 |
4 files changed, 44 insertions, 11 deletions
diff --git a/cholerab/AGENDA.cccamp11 b/cholerab/AGENDA.cccamp11 index a56881c2..bb35f911 100644 --- a/cholerab/AGENDA.cccamp11 +++ b/cholerab/AGENDA.cccamp11 @@ -15,11 +15,23 @@ - query args - make-based installer for voice-symlinks + - ttycnser + - server component + - JSON-RPC [spec and implementation] + - client component + - ttycnser (makefu) + DONE - Python Notification (makefu) + - growl (pfleidi) + + - krebs rebootstrapping + DONE - curl painload.retiolum | sh + [- git clone https://github.com/kreingbscode/painload /krebs] + [- /krebs/boot] (makefu) - krebs rebootstrapping - server, der ein shellscript [wenn User-Agent: curl/wget ist] ausgibt] (tv) - painload/{component}/krebs.manifest - - welche kategorie: gutartig, boesartig, optional - - interactive-foo, der am Anfang durchgespielt werden muss + - welche kategorie: gutartig, boesartig,auf toeten eingestellt, optional + DONE - interactive-foo, der am Anfang durchgespielt werden muss - danach darf er nciht mehr sucken, und muss das richtige tun - initiale config file via $EDITOR - config auswerten @@ -58,10 +70,12 @@ - git hooks - Error 1: "Keyword-ratio below 9k" - keyword file + - <-- tinc tar file updaten - default configuration for $EDITOR & co. - Refactort git-eternal-move: use find instead of mv + - make it not suck, e.g. do the right thing (currently NOT) - NetworkEngineer - kill and replace NetworkManager 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 diff --git a/retiolum/scripts/tinc_setup/install.sh b/retiolum/scripts/tinc_setup/install.sh index 0902d417..526dbe1f 100755 --- a/retiolum/scripts/tinc_setup/install.sh +++ b/retiolum/scripts/tinc_setup/install.sh @@ -1,6 +1,6 @@ #! /bin/sh # USE WITH GREAT CAUTION -set -euf +set -eu if test "${nosudo-false}" != true -a `id -u` != 0; then echo "we're going sudo..." >&2 @@ -12,7 +12,7 @@ fi set -e DIRNAME=`dirname $0` CURR=`readlink -f ${DIRNAME}` -MYBIN=../../bin +MYBIN=${CURR}/../../bin netname=retiolum # create configuration directory for $netname mkdir -p /etc/tinc/$netname/hosts @@ -37,18 +37,13 @@ then then echo "select v4 subnet ip (1-255) :" read v4num - myipv4=10.7.7.$v4num - if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; - then - echo "check" - else - echo "you are made of stupid. bailing out" + if ! $MYBIN/check-free-retiolum-v4 $v4num;then exit 1 fi fi echo "Subnet = $myipv4" > hosts/$myname - myipv6=`${CURR}/../../bin/fillxx 42:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx`/128 + myipv6=`$MYBIN/fillxx 42:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx`/128 echo "Subnet = $myipv6" >> hosts/$myname else echo "own host file already exists! will not write again!" |