diff options
author | makefu <root@pigstarter.de> | 2013-09-27 16:06:27 +0200 |
---|---|---|
committer | makefu <root@pigstarter.de> | 2013-09-27 16:06:27 +0200 |
commit | 473981b112d89bf6401be7e164bca4b91b1cdb2b (patch) | |
tree | a48201785fc037218f468041fbd85532996d991b | |
parent | b4b735b6a1e14de84edd40ad2badcc1746235696 (diff) |
add is_root to core
-rw-r--r-- | lib/core | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |