Sometimes I want to make sure that a script is *not* being run by the root user:
#!/bin/bash if [[ $EUID -eq 0 ]]; then echo "Don't run as root!" exit 1 fi
I jot things down, in hopes of finding them later…
Sometimes I want to make sure that a script is *not* being run by the root user:
#!/bin/bash if [[ $EUID -eq 0 ]]; then echo "Don't run as root!" exit 1 fi
Posted in Bash, Tips and Tricks.
– November 4, 2009
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.