#!/usr/bin/env bash do_with_root() { if [[ `whoami` = 'root' ]]; then $* elif [[ -x /bin/sudo || -x /usr/bin/sudo ]]; then echo "sudo $*" sudo $* else echo -e "${BOrange}Please run this script as root.${Color_Off}" exit 1 fi } EXIT1() { clear exit 0 }