Re: How can a program know whether it is running in superuser mode?

new topic     » goto parent     » topic index » view thread      » older message » newer message

sorry forgot to give an example

if [[ $EUID -ne 0 ]]; then 
   echo "This script must be run as root" 1>&2 
   exit 1 
fi 

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu