Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Exit bash script if not running as root

[[ $EUID -ne 0 ]] && echo "This script must be run as root." && exit 1
Source by askubuntu.com #
 
PREVIOUS NEXT
Tagged: #Exit #bash #script #running #root
ADD COMMENT
Topic
Name
8+9 =