Remove ${SUDO} usages and root checks from scripts called by pihole
command as they should not be called directly.
This commit is contained in:
16
pihole
16
pihole
@@ -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() {
|
||||
|
Reference in New Issue
Block a user