> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Patrick Leslie Polzer
> Sent: Friday, January 06, 2006 3:50 PM
> To: General Discusson about Arch Linux
> Subject: Re: [arch] Checking for (root)permissions in various
> Archlinux-scripts
>
On Fri, 6 Jan 2006 21:13:27 +0100
Benjamin Andresen <Benjamin Andresen <[EMAIL PROTECTED]>> wrote:
| I think this would only complicate stuff. And Arch has this very well
| working KISS philosophy.
A simple
if [ ! $UID -eq 0 ]; then
echo "you must be root!"
exit
fi
in front of each script would not complicate matters that much (even less
if it would be made generic and sourced) and be quite handy IMO.
| If it happens multiple times to you... Try to get some better shell
| settings to visualize when you are root or not.
Some people like to never login as root and use sudo, for example.
Leslie
--
Actually that code wouldn't work for someone who's using sudo:
[EMAIL PROTECTED] ~]$ echo $UID
1000
[EMAIL PROTECTED] ~]$ sudo echo $UID
1000
DR
==============================================================================
Please access the attached hyperlink for an important electronic communications
disclaimer:
http://www.csfb.com/legal_terms/disclaimer_external_email.shtml
==============================================================================
_______________________________________________
arch mailing list
[email protected]
http://www.archlinux.org/mailman/listinfo/arch