X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=functions.sh;h=a818b344f13a56608a71a26a90612849f45c0dae;hb=01968242e3b13b6f0d59e35e612a824780927ab0;hp=bf92729dc941aeab754cc3f58b458544a974cfd8;hpb=faaf01a6e019eadf76bfb8960cbbffa7f1c4c921;p=carnet-tools-cn.git diff --git a/functions.sh b/functions.sh index bf92729..a818b34 100644 --- a/functions.sh +++ b/functions.sh @@ -302,7 +302,7 @@ cp_db_get() { # check to prevent user from using this before activating debconf # confmodule needs to be loaded before accessing db_* functions if [ -z "$DEBCONF_REDIR" ]; then - echo "cp_db_get_wrap: debconf not activated!" >&2 + echo "cp_db_get: debconf not activated!" >&2 return 1 fi @@ -318,3 +318,18 @@ 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() { + local euid + 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 +}