Re: Forcing script to run as root?

2005-01-18 Thread Randal L. Schwartz
Brian == Brian Barto [EMAIL PROTECTED] writes: Brian Hi all. How can I check, within a script, to see if it is being Brian run as root or not? I would like it to exit with an error Brian message if it is not running as root. die we need more power! if $; -- Randal L. Schwartz - Stonehenge

Re: Forcing script to run as root?

2005-01-17 Thread Tor Hildrum
On Mon, 17 Jan 2005 14:08:10 -0500, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Worked perfectly. I knew it was something simple. Thanks! Never used POSIX before. Looked at it on cpan but those descriptions can be flat sometimes. If you don't mind, what are some practical uses for it? Just

Re: Forcing script to run as root?

2005-01-17 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hi all. How can I check, within a script, to see if it is being run as root or not? I would like it to exit with an error message if it is not running as root. I'm looking for something that works across *nix platforms so that my script is portable. Is there a perl