Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to make bash script must be ran in sudo

if [[ $(/usr/bin/id -u) -ne 0 ]]; then
    echo "Not running as root"
    exit
fi
Source by serverfault.com #
 
PREVIOUS NEXT
Tagged: #bash #script #ran #sudo
ADD COMMENT
Topic
Name
5+4 =