From dec9eefb3608044a62d285a5e0b7185bc610086c Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 14 Nov 2013 10:03:11 +0100 Subject: ship remaster_arch_iso: s/error;exit/die/ --- ship/src/remaster_arch_iso | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'ship/src') diff --git a/ship/src/remaster_arch_iso b/ship/src/remaster_arch_iso index 046b005b..d089f872 100755 --- a/ship/src/remaster_arch_iso +++ b/ship/src/remaster_arch_iso @@ -27,9 +27,7 @@ info "mounting isofile ($isofile)" if is_root;then mount -t iso9660 -o loop,ro $isofile $isomnt else - error "we are not root enough to mount the iso. Bailing Out" - exit 1 - + die 'we are not root enough to mount the iso. Bailing Out' fi defer "info 'unmounting $isomnt';umount $isomnt" -- cgit v1.2.3 From 9e12def06b7775dbfcae28b17ce3ba96ba08c0d1 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 14 Nov 2013 10:10:04 +0100 Subject: ship lib/retiolum: s/error;exit/die/g --- ship/src/retiolum | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'ship/src') diff --git a/ship/src/retiolum b/ship/src/retiolum index d6e0efdc..ede1fd6a 100755 --- a/ship/src/retiolum +++ b/ship/src/retiolum @@ -38,33 +38,28 @@ main(){ if [ $IP4 -eq 0 ]; then RAND4=1 elif ! check_ip_valid4 $IP4; then - echo 'ip4 is invalid' - exit 1 + die 'ip4 is invalid' fi if [ $IP6 -eq 0 ]; then RAND6=1 elif ! check_ip_valid6 $IP6; then - echo 'ip6 is invalid' - exit 1 + die 'ip6 is invalid' fi #check if everything is installed if ! exists awk ; then - echo "Please install awk" - exit 1 + die 'Please install awk' fi if ! http_head $SURL >/dev/null 2>/dev/null ;then - echo "Cannot find supernode package, check if your internet is working" - exit 1 + die 'Cannot find supernode package, check if your internet is working' fi #check if everything is installed if [ $OS = 'android' ]; then if ! test -e /data/data/org.poirsouille.tinc_gui/files/tincd; then - echo "Please install tinc-gui" - exit 1 + die 'Please install tinc-gui' else TINCBIN=/data/data/org.poirsouille.tinc_gui/files/tincd DEV="/dev/tun" @@ -75,8 +70,7 @@ main(){ fi elif [ $OS = 'osx' ]; then if ! exists tincd >/dev/null; then - echo "Please install tinc" - exit 1 + die 'Please install tinc' else TINCBIN=tincd DEV="/dev/net/tun" @@ -85,8 +79,7 @@ main(){ fi else if ! exists tincd >/dev/null; then - echo "Please install tinc" - exit 1 + die 'Please install tinc' else TINCBIN=tincd DEV="/dev/net/tun" @@ -99,8 +92,7 @@ main(){ #test if tinc directory already exists if test -e $TINCDIR/$NETNAME; then - echo "tinc config directory $TINCDIR/$NETNAME does already exist. (backup and) delete config directory and restart" - exit 1 + die "tinc config directory $TINCDIR/$NETNAME does already exist. (backup and) delete config directory and restart" fi #get tinc-hostfiles @@ -243,7 +235,7 @@ host2subnet() 2) FULLSUBNET=$SUBNET4.0.0 ;; 1) FULLSUBNET=$SUBNET4.0 ;; 0) FULLSUBNET=$SUBNET4 ;; - *) echo "cannot read subnet" && exit 1;; + *) die 'cannot read subnet';; esac } -- cgit v1.2.3 From 168f5927f4a7b69b23f7d90e5a2dd36c6fe78a01 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 14 Nov 2013 10:40:32 +0100 Subject: ship: move all "bailing out" msgs to die --- ship/src/remaster_arch_iso | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ship/src') diff --git a/ship/src/remaster_arch_iso b/ship/src/remaster_arch_iso index d089f872..66d5bc05 100755 --- a/ship/src/remaster_arch_iso +++ b/ship/src/remaster_arch_iso @@ -13,7 +13,7 @@ rootdir=$bdir/root outdir=$bdir/out auto_url=euer.krebsco.de/autoinstall info "bdir is at $bdir" -[ ! -e "$isofile" ] && die "$isofile does not exist,bailing out" +[ ! -e "$isofile" ] && die "$isofile does not exist." esudo "$@" @@ -27,7 +27,7 @@ info "mounting isofile ($isofile)" if is_root;then mount -t iso9660 -o loop,ro $isofile $isomnt else - die 'we are not root enough to mount the iso. Bailing Out' + die 'we are not root enough to mount the iso.' fi defer "info 'unmounting $isomnt';umount $isomnt" -- cgit v1.2.3 From 36a7b004e2d3bbc3858a6378b3ef19ea3e15f4a1 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 14 Nov 2013 14:04:57 +0100 Subject: ship punani: mv user interface to src/ --- ship/src/punani | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'ship/src') diff --git a/ship/src/punani b/ship/src/punani index ceabd667..61043bc0 100755 --- a/ship/src/punani +++ b/ship/src/punani @@ -1,4 +1,47 @@ #! /bin/sh #@info #@include punani +punani(){ + _punani_usage='punani {install,remove,has} PACKAGE...' + _punani_select_packer || die 'no package manager found; no punani for you!' + + ACTION="$1"; shift + + if test $# = 0; then + error 'no PACKAGE specified.' + die "usage: $_punani_usage" + fi + + for PKG; do + RES="`_punani_resolve_package $PKG`" || + die "could not resolve '$PKG'; no punani for you!" + + case "$ACTION" in + install) + if punani_has $RES; then + info "$RES already installed, skipping" + else + punani_install $RES || error "cannot install $RES with $PACKER" + fi + ;; + remove) + if ! punani_has $RES; then + info "$RES not installed, skipping" + else + punani_remove $RES || error "cannot install $RES with $PACKER" + fi + ;; + has) + if punani_has $RES; then + info "$RES is installed" + else + info "$RES is not installed" + fi + ;; + *) + error "bad action: $ACTION" + die "usage: $_punani_usage" + esac + done +} punani "$@" -- cgit v1.2.3 From fd3ddc6abe23f83f304c2043fe9cabe1ee8a622c Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 14 Nov 2013 14:13:35 +0100 Subject: ship punani: add experimental owner interface --- ship/src/punani | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ship/src') diff --git a/ship/src/punani b/ship/src/punani index 61043bc0..2c956f02 100755 --- a/ship/src/punani +++ b/ship/src/punani @@ -2,7 +2,7 @@ #@info #@include punani punani(){ - _punani_usage='punani {install,remove,has} PACKAGE...' + _punani_usage='punani {install,remove,has,owner} PACKAGE...' _punani_select_packer || die 'no package manager found; no punani for you!' ACTION="$1"; shift @@ -38,6 +38,9 @@ punani(){ info "$RES is not installed" fi ;; + owner) + punani_owner $RES + ;; *) error "bad action: $ACTION" die "usage: $_punani_usage" -- cgit v1.2.3