You are not logged in.
I used to have this in bash scripts to check for root privileges:
if [ "$UID" -ne "$ROOT_UID" ] ; then
echo "You must be root to do that!"
exit 1
fiHowever recently (since a few weeks?) it seems ROOT_UID is no longer set : env | grep ROOT_UID results nothing. I could of course just check for UID 0 instead but I wonder why ROOT_UID does no longer exist. Has it become obsolete? I couldn't find anything on the forum or wiki about this.
Offline
You can use the value of $EUID or $UID directly (0 == root) or the output of "whoami" (root == root)
Or you can just export ROOT_UID=0 (asuming you haven't set root's uid to something silly) somewhere at startup...but I don't know the answer to your question (why it's no longer set)
Last edited by moljac024 (2009-09-20 15:03:33)
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline