X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=functions.sh;h=93c98df4a50a09f55d7cd20829e8d89ad9a01ca1;hb=36a474a7cab35a2686bac6c07d3fdd8040540a5b;hp=70c914c82dda6717bc53b2237223697ec608c661;hpb=4f6a5bb71f6bfb227d962ee610bf63484100daf5;p=carnet-upgrade.git diff --git a/functions.sh b/functions.sh index 70c914c..93c98df 100644 --- a/functions.sh +++ b/functions.sh @@ -318,3 +318,17 @@ cp_db_get() { fi } +# by ddzeko, Tue, 05 Apr 2005 15:47:37 +0200 +# - check is the script run by effective root +cp_check_root() { + euid=`awk 'BEGIN{print PROCINFO["euid"]}'` + case "$euid" in + 0) RET=y + return 0 ;; + ?*) RET=n + return 1 ;; + *) RET="" + echo "cp_check_root: cannot determine euid" 2>&1 + ;; + esac +}