Remove ${SUDO} usages and root checks from scripts called by pihole command as they should not be called directly.

This commit is contained in:
Promofaux
2016-10-15 17:54:04 +01:00
parent 461de48625
commit 090fbd04af
5 changed files with 51 additions and 95 deletions

16
pihole
View File

@@ -12,14 +12,14 @@
# Must be root to use this tool
if [[ ! $EUID -eq 0 ]];then
if [ -x "$(command -v sudo)" ];then
echo "::: Elevating to root with sudo"
exec sudo bash "$0" "$@"
exit $?
else
echo "::: sudo is needed to run pihole commands. Please run this script as root or install sudo."
exit 1
fi
if [ -x "$(command -v sudo)" ];then
echo "::: Elevating to root with sudo"
exec sudo bash "$0" "$@"
exit $?
else
echo "::: sudo is needed to run pihole commands. Please run this script as root or install sudo."
exit 1
fi
fi
whitelistFunc() {