[ Thanks to Andrew
Weber for this link. ]
“A common question that is asked is, “How do you make sure only
root can run a script?”. There are several ways to make this
happen. A common method is to write a test to verify the user ID.
The command that is often used for this task is id. The id command
has an option “-u” that returns the UID of the person executing it
so it is an easy solution to implement.”