projects
/
carnet-tools-cn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f6a5bb
)
r43: Dodan cp_check_root
author
Damir Dzeko
<Damir.Dzeko@CARNet.hr>
Tue, 5 Apr 2005 13:48:56 +0000
(13:48 +0000)
committer
Damir Dzeko
<Damir.Dzeko@CARNet.hr>
Tue, 5 Apr 2005 13:48:56 +0000
(13:48 +0000)
functions.sh
patch
|
blob
|
history
diff --git
a/functions.sh
b/functions.sh
index
70c914c
..
93c98df
100644
(file)
--- 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
+}