summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2013-09-27 16:06:27 +0200
committermakefu <root@pigstarter.de>2013-09-27 16:06:27 +0200
commit473981b112d89bf6401be7e164bca4b91b1cdb2b (patch)
treea48201785fc037218f468041fbd85532996d991b
parentb4b735b6a1e14de84edd40ad2badcc1746235696 (diff)
add is_root to core
-rw-r--r--lib/core4
1 files changed, 3 insertions, 1 deletions
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