Salir del script bash si no se ejecuta como root

[[ $EUID -ne 0 ]] && echo "This script must be run as root." && exit 1
Foolish Frog