13 lines
283 B
Bash
Executable File
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
|
|
} |