From 473981b112d89bf6401be7e164bca4b91b1cdb2b Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 27 Sep 2013 16:06:27 +0200 Subject: add is_root to core --- lib/core | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core b/lib/core index f6516b5e..6d126142 100644 --- a/lib/core +++ b/lib/core @@ -5,7 +5,9 @@ msg() { printf "$@\n" >&2 ;} info() { msg "** $@" ;} error() { msg "!! $@" ;} exists(){ type "$1" >/dev/null 2>/dev/null; } - +is_root(){ + test $(id -u) -eq 0 +} get_hostname(){ # finds the current hostname # if ENV HOSTN is set echo $HOSTN -- cgit v1.2.3