mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
remove calls for ${SUDO} as per basic-install.sh.
This commit is contained in:
parent
5ea08a2120
commit
5e883239f9
37
pihole
37
pihole
@ -12,38 +12,35 @@
|
|||||||
|
|
||||||
# Must be root to use this tool
|
# Must be root to use this tool
|
||||||
if [[ ! $EUID -eq 0 ]];then
|
if [[ ! $EUID -eq 0 ]];then
|
||||||
#echo "::: You are root."
|
|
||||||
#else
|
|
||||||
#echo "::: Sudo will be used for this tool."
|
|
||||||
# Check if it is actually installed
|
|
||||||
# If it isn't, exit because the pihole cannot be invoked without privileges.
|
|
||||||
if [ -x "$(command -v sudo)" ];then
|
if [ -x "$(command -v sudo)" ];then
|
||||||
export SUDO="sudo"
|
echo "::: Elevating to root with sudo"
|
||||||
|
exec sudo bash "$0" "$@"
|
||||||
|
exit $?
|
||||||
else
|
else
|
||||||
echo "::: Please install sudo or run this as root."
|
echo "::: sudo is needed to run pihole commands. Please run this script as root or install sudo."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function whitelistFunc {
|
function whitelistFunc {
|
||||||
shift
|
shift
|
||||||
${SUDO} /opt/pihole/whitelist.sh "$@"
|
/opt/pihole/whitelist.sh "$@"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function blacklistFunc {
|
function blacklistFunc {
|
||||||
shift
|
shift
|
||||||
${SUDO} /opt/pihole/blacklist.sh "$@"
|
/opt/pihole/blacklist.sh "$@"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function debugFunc {
|
function debugFunc {
|
||||||
${SUDO} /opt/pihole/piholeDebug.sh
|
/opt/pihole/piholeDebug.sh
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function flushFunc {
|
function flushFunc {
|
||||||
${SUDO} /opt/pihole/piholeLogFlush.sh
|
/opt/pihole/piholeLogFlush.sh
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +83,7 @@ function updatePiholeFunc {
|
|||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Fetching latest changes from GitHub..."
|
echo "::: Fetching latest changes from GitHub..."
|
||||||
cd /var/www/html/admin
|
cd /var/www/html/admin
|
||||||
${SUDO} git pull origin master
|
git pull origin master
|
||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Pi-hole Web Admin has been updated to ${webVersion}"
|
echo "::: Pi-hole Web Admin has been updated to ${webVersion}"
|
||||||
echo "::: See https://changes.pi-hole.net for details"
|
echo "::: See https://changes.pi-hole.net for details"
|
||||||
@ -101,8 +98,8 @@ function updatePiholeFunc {
|
|||||||
|
|
||||||
echo "::: Fetching latest changes from GitHub..."
|
echo "::: Fetching latest changes from GitHub..."
|
||||||
cd /etc/.pihole
|
cd /etc/.pihole
|
||||||
${SUDO} git pull origin master
|
git pull origin master
|
||||||
${SUDO} /etc/.pihole/automated\ install/basic-install.sh pihole
|
/etc/.pihole/automated\ install/basic-install.sh pihole
|
||||||
|
|
||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Pi-hole has been updated to version ${piholeVersionLatest}"
|
echo "::: Pi-hole has been updated to version ${piholeVersionLatest}"
|
||||||
@ -117,17 +114,17 @@ function updatePiholeFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function reconfigurePiholeFunc {
|
function reconfigurePiholeFunc {
|
||||||
${SUDO} /etc/.pihole/automated\ install/basic-install.sh
|
/etc/.pihole/automated\ install/basic-install.sh
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateGravityFunc {
|
function updateGravityFunc {
|
||||||
${SUDO} /opt/pihole/gravity.sh "$@"
|
/opt/pihole/gravity.sh "$@"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupLCDFunction {
|
function setupLCDFunction {
|
||||||
${SUDO} /opt/pihole/setupLCD.sh
|
/opt/pihole/setupLCD.sh
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,18 +144,18 @@ function queryFunc {
|
|||||||
|
|
||||||
function chronometerFunc {
|
function chronometerFunc {
|
||||||
shift
|
shift
|
||||||
${SUDO} /opt/pihole/chronometer.sh "$@"
|
/opt/pihole/chronometer.sh "$@"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function uninstallFunc {
|
function uninstallFunc {
|
||||||
${SUDO} /opt/pihole/uninstall.sh
|
/opt/pihole/uninstall.sh
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function versionFunc {
|
function versionFunc {
|
||||||
${SUDO} /opt/pihole/version.sh
|
/opt/pihole/version.sh
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user