diff options
author | EUcancER <root@euer.krebsco.de> | 2011-11-16 18:36:47 +0100 |
---|---|---|
committer | EUcancER <root@euer.krebsco.de> | 2011-11-16 18:36:47 +0100 |
commit | 8bd34ad18888cbed1ffa894406db6c667f6ebaae (patch) | |
tree | 2f102bbb974682291a461f474340144d21aed3cc /punani | |
parent | c97518523b910ca7412f69de3803739affe2c583 (diff) | |
parent | 655db45a3ef4ca58f9e9fe42bba015d1fd1eccb6 (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'punani')
-rwxr-xr-x | punani/tightnani/tightnani_client | 59 | ||||
-rw-r--r-- | punani/tightnani/tightnani_db | 6 |
2 files changed, 64 insertions, 1 deletions
diff --git a/punani/tightnani/tightnani_client b/punani/tightnani/tightnani_client new file mode 100755 index 00000000..8caf669e --- /dev/null +++ b/punani/tightnani/tightnani_client @@ -0,0 +1,59 @@ +#!/bin/bash +set -euf + +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!" + exit 23 +fi + + +# find the package name +PKG="$2" +RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER/$PKG 2>/dev/null` +if [ ! "$RESOLVED" ];then + echo "Could not resolve your requested package, bailing out!" + exit 23 +fi +case "$1" in + install) + exec $PACKER_CMD $INSTALL_PARAM $RESOLVED + ;; + remove) + exec $PACKER_CMD $REMOVE_PARAM $RESOLVED + ;; + *) + echo "usage: `basename $0` (install|remove) PACKAGE" +esac diff --git a/punani/tightnani/tightnani_db b/punani/tightnani/tightnani_db index 4c2d4843..6ae8098c 100644 --- a/punani/tightnani/tightnani_db +++ b/punani/tightnani/tightnani_db @@ -24,5 +24,9 @@ "python3" : { "apt-get" : "python3", "pacman" : "python" - } + }, + "tinc" : { + "apt-get" : "tinc", + "yaourt" : "tinc" + } } |