summaryrefslogtreecommitdiffstats
path: root/ship/lib/core
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-11-19 08:35:51 +0100
committermakefu <github@syntax-fehler.de>2013-11-19 08:35:51 +0100
commit5788b95fe7834d3049df9de1009f3d8dbc34fea2 (patch)
tree76675a9579c7c5e269825bfa73d29fe5256b8afb /ship/lib/core
parentc15a8d15e910a39a641b21df08e13325a0e29293 (diff)
parent6f956cfe65ee00871bc9be19b2acadabb6638a69 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'ship/lib/core')
-rw-r--r--ship/lib/core13
1 files changed, 9 insertions, 4 deletions
diff --git a/ship/lib/core b/ship/lib/core
index d1a7333e..d6e01352 100644
--- a/ship/lib/core
+++ b/ship/lib/core
@@ -1,8 +1,13 @@
# logging
-msg() { printf "$@\n" >&2 ;}
-info() { msg "** $@" ;}
-error() { msg "!! $@" ;}
-die() { error "$@" ;exit 1;}
+msg() { echo "$*" >&2; }
+info() { msg "** $*"; }
+error() { msg "!! $*"; }
+## usage: die [REASON...]
+die() {
+ test $# -gt 0 && error "$*"
+ error 'Bailing out.'
+ exit 1
+}
exists(){ type "$1" >/dev/null 2>/dev/null; }
is_root(){
test $(id -u) -eq 0