Files
Misc-Scripts/default.inc
2018-10-02 21:01:12 -05:00

13 lines
283 B
Bash
Executable File

#!/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
}