From 675efc153714786384bbf84bcd9066c452f6bbbe Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 17 Nov 2011 11:24:46 +0100 Subject: added defaultroutes!! testing ftw --- retiolum/hosts/Lassulus | 1 + retiolum/hosts/Styx | 1 + retiolum/hosts/supernode | 1 + 3 files changed, 3 insertions(+) diff --git a/retiolum/hosts/Lassulus b/retiolum/hosts/Lassulus index 594d1203..f794d06c 100644 --- a/retiolum/hosts/Lassulus +++ b/retiolum/hosts/Lassulus @@ -1,5 +1,6 @@ Subnet = 42:0:0:0:0:0:0:dea7/128 Subnet = 42.251.103.67/32 +Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAsj1PCibKOfF68gmFQ+wwyfhUWpqKqpznrJX1dZ+daae7l7nBHvsE H0QwkiMmk3aZy1beq3quM6gX13aT+/wMfWnLyuvT11T5C9JEf/IS91STpM2BRN+R diff --git a/retiolum/hosts/Styx b/retiolum/hosts/Styx index 37083ddc..b05eaac5 100644 --- a/retiolum/hosts/Styx +++ b/retiolum/hosts/Styx @@ -1,4 +1,5 @@ Subnet = 42.37.61.123/32 +Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEA4jbOi+HZIGOGNm4aBSwnq4m3Vg3IXHmYUbJx1AzP4a/yvEgswfk6 MP5FXvoY/hZ0NQ0IRzbbJxGbcUdulz0WSjX1C+8uQUZstz+lvYZ4FeCXcdE5cuFM diff --git a/retiolum/hosts/supernode b/retiolum/hosts/supernode index b046347e..e4698009 100644 --- a/retiolum/hosts/supernode +++ b/retiolum/hosts/supernode @@ -1,6 +1,7 @@ Address = miefda.org Subnet = 42:0:0:0:0:0:0:255/128 Subnet = 42.0.0.1/32 +Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAr3DlBmQxP9UTBCkohK8FCYSk2td4Ov5lQYvC3Adx04lEWHfp+0nP sShYqqN9Aj3iCqj/DHx5jGuSqjyTmmFWIOMM9IwKMo2Oiz/PcBM56N6gzIHuR5wj -- cgit v1.2.3 From df68b03094570c25e9f0a337d162c9be8b98a75c Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 18 Nov 2011 10:36:48 +0100 Subject: removed defaultroute --- retiolum/hosts/Styx | 1 - 1 file changed, 1 deletion(-) diff --git a/retiolum/hosts/Styx b/retiolum/hosts/Styx index b05eaac5..37083ddc 100644 --- a/retiolum/hosts/Styx +++ b/retiolum/hosts/Styx @@ -1,5 +1,4 @@ Subnet = 42.37.61.123/32 -Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEA4jbOi+HZIGOGNm4aBSwnq4m3Vg3IXHmYUbJx1AzP4a/yvEgswfk6 MP5FXvoY/hZ0NQ0IRzbbJxGbcUdulz0WSjX1C+8uQUZstz+lvYZ4FeCXcdE5cuFM -- cgit v1.2.3 From fea2dd9f1e17e0eafd889c04b7407b753a7764d9 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 19 Nov 2011 23:47:50 +0100 Subject: //retiolum hosts: use correct format --- retiolum/bin/hosts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retiolum/bin/hosts b/retiolum/bin/hosts index bd0c77dc..4856d494 100755 --- a/retiolum/bin/hosts +++ b/retiolum/bin/hosts @@ -7,7 +7,7 @@ cd /etc/tinc/$netname/hosts for i in `ls`; do sed -n ' - s|^ *Subnet *= *\([^ /]*\)\(/[0-9]*\)\? *$|\1\t'$i' '$i'.'$netname'|p + s|^ *Subnet *= *\([^ /]*\)\(/[0-9]*\)\? *$|\1\t'$i'.'$netname' '$i'|p ' $i done | sort -- cgit v1.2.3 From 63df8cd12335300e5af7940a80fa04d660bb04ec Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Nov 2011 01:22:25 +0100 Subject: //punani: dispel $PACKER-magic --- punani/bin/punani | 61 ++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index 8caf669e..7be91db4 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -1,48 +1,45 @@ -#!/bin/bash +#! /bin/sh set -euf +TIGHTNANI_HOST="${TIGHTNANI_HOST-http://euer.krebsco.de:9111}" + if [ $# -ne 2 ];then echo "usage: `basename $0` (install|remove) PACKAGE" exit 23 fi -PACKERS="yum!-y install remove -brew install remove -pacman!--noconfirm -S!--needed -Rcs -bauerbill!--noconfirm -S!--needed -Rcs -yaourt!--noconfirm -S!--needed -Rcs -packer!--noconfirm -S!--needed -Rcs -apt-get!--yes install remove -aptitude!--yes install remove" - -OIFS=$IFS -PACKER= -IFS=' -' - -TIGHTNANI_HOST="http://euer.krebsco.de:9111" -# Find suitable packer -for PACKER_LINE in $PACKERS; do - TRY_PACKER_CMD="$(echo "$PACKER_LINE" | cut -d ' ' -f 1)" - TRY_PACKER="$(echo "$TRY_PACKER_CMD" | cut -d '!' -f 1)" - if which $TRY_PACKER &>/dev/null; then - PACKER=$TRY_PACKER - PACKER_CMD="$(echo "$TRY_PACKER_CMD" | tr "!" " ")" - echo "you got $PACKER" - INSTALL_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 2 | tr "!" " ")" - REMOVE_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 3 | tr "!" " ")" - fi -done -IFS=$OIFS -if [ ! "$PACKER" ];then - echo "Could not find a supported packer for you, bailing out!" +## find package manager +if ! :; then : # dummy, so the rest has a common format + +elif for PACKER_CMD in yum + do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then + INSTALL_PARAM='-y install' + REMOVE_PARAM='-y remove' + +elif for PACKER_CMD in brew + do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then + INSTALL_PARAM='install' + REMOVE_PARAM='remove' + +elif for PACKER_CMD in bauerbill packer yaourt pacman + do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then + INSTALL_PARAM='--noconfirm -S' + REMOVE_PARAM='--needed -Rcs' + +elif for PACKER_CMD in aptitude apt-get + do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then + INSTALL_PARAM='--yes install' + REMOVE_PARAM='--yes remove' + +else + echo "Error 2: no known package manager found; no punani for you!" >&2 exit 23 fi # find the package name PKG="$2" -RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER/$PKG 2>/dev/null` +RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null` if [ ! "$RESOLVED" ];then echo "Could not resolve your requested package, bailing out!" exit 23 -- cgit v1.2.3 From 98c73906645364805fe512bec3856db6706f6a78 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Nov 2011 01:29:10 +0100 Subject: //punani: fix bug when wget (+ set -e) GETs no OK --- punani/bin/punani | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index 7be91db4..b96539ff 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -9,7 +9,7 @@ if [ $# -ne 2 ];then fi ## find package manager -if ! :; then : # dummy, so the rest has a common format +if ! :; then : # dummy case, so the rest has a common format elif for PACKER_CMD in yum do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then @@ -36,14 +36,15 @@ else exit 23 fi - -# find the package name +## find package name PKG="$2" -RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null` +RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null || :` if [ ! "$RESOLVED" ];then - echo "Could not resolve your requested package, bailing out!" + echo "Error 2: could not resolve '$PKG'; no punany for you!" >&2 exit 23 fi + +## dispatch case "$1" in install) exec $PACKER_CMD $INSTALL_PARAM $RESOLVED -- cgit v1.2.3 From 82a089ca49712882baecad9244e2233c56b22075 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Sun, 20 Nov 2011 08:59:10 +0100 Subject: //punani: fix logic fuckup after refactoring,typo also, tightnani->punani --- punani/bin/punani | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index b96539ff..1de743e2 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -1,7 +1,7 @@ #! /bin/sh set -euf -TIGHTNANI_HOST="${TIGHTNANI_HOST-http://euer.krebsco.de:9111}" +PUNANI_HOST="${PUNANI_HOST-http://euer.krebsco.de:9111}" if [ $# -ne 2 ];then echo "usage: `basename $0` (install|remove) PACKAGE" @@ -23,8 +23,8 @@ elif for PACKER_CMD in brew elif for PACKER_CMD in bauerbill packer yaourt pacman do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then - INSTALL_PARAM='--noconfirm -S' - REMOVE_PARAM='--needed -Rcs' + INSTALL_PARAM='--noconfirm -S --needed' + REMOVE_PARAM='-Rcs' elif for PACKER_CMD in aptitude apt-get do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then @@ -38,9 +38,9 @@ fi ## find package name PKG="$2" -RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null || :` +RESOLVED=`wget -O- $PUNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null || :` if [ ! "$RESOLVED" ];then - echo "Error 2: could not resolve '$PKG'; no punany for you!" >&2 + echo "Error 2: could not resolve '$PKG'; no punani for you!" >&2 exit 23 fi -- cgit v1.2.3 From 4b8fe23246540d1a9dded43d40f01bb093dbfb06 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Nov 2011 11:33:47 +0100 Subject: //punani: set -x and then go sudo --- punani/bin/punani | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index 1de743e2..a7e86d96 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -47,10 +47,12 @@ fi ## dispatch case "$1" in install) - exec $PACKER_CMD $INSTALL_PARAM $RESOLVED + set -x + exec sudo $PACKER_CMD $INSTALL_PARAM $RESOLVED ;; remove) - exec $PACKER_CMD $REMOVE_PARAM $RESOLVED + set -x + exec sudo $PACKER_CMD $REMOVE_PARAM $RESOLVED ;; *) echo "usage: `basename $0` (install|remove) PACKAGE" -- cgit v1.2.3 From 4c53eae0cd6d1644f5ad3e79e5eb5611975079a1 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Nov 2011 11:49:00 +0100 Subject: //punani: allow multiple PACKAGE --- punani/bin/punani | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index a7e86d96..4be74f77 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -2,11 +2,8 @@ set -euf PUNANI_HOST="${PUNANI_HOST-http://euer.krebsco.de:9111}" - -if [ $# -ne 2 ];then - echo "usage: `basename $0` (install|remove) PACKAGE" - exit 23 -fi +ACTION="$1"; shift +PKGS="$*" ## find package manager if ! :; then : # dummy case, so the rest has a common format @@ -37,15 +34,22 @@ else fi ## find package name -PKG="$2" -RESOLVED=`wget -O- $PUNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null || :` -if [ ! "$RESOLVED" ];then - echo "Error 2: could not resolve '$PKG'; no punani for you!" >&2 - exit 23 +if test -n "$PKGS"; then + for PKG in $PKGS; do + RES="`wget -O- $PUNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null || :`" + if [ ! "$RES" ]; then + echo "Error 2: could not resolve '$PKG'; no punani for you!" >&2 + exit 23 + fi + RESOLVED="${RESOLVED+$RESOLVED }$RES" + done +else + echo "Error 1: no PACKAGE specified." >&2 + ACTION="usage" fi ## dispatch -case "$1" in +case "$ACTION" in install) set -x exec sudo $PACKER_CMD $INSTALL_PARAM $RESOLVED @@ -55,5 +59,6 @@ case "$1" in exec sudo $PACKER_CMD $REMOVE_PARAM $RESOLVED ;; *) - echo "usage: `basename $0` (install|remove) PACKAGE" + echo "usage: `basename $0` (install|remove) PACKAGE..." + exit 23 esac -- cgit v1.2.3