diff --git a/advanced/pihole.sudo b/advanced/pihole.sudo new file mode 100644 index 00000000..ef06249a --- /dev/null +++ b/advanced/pihole.sudo @@ -0,0 +1,12 @@ +# Pi-hole: A black hole for Internet advertisements +# (c) 2015, 2016 by Jacob Salmela +# Network-wide ad blocking via your Raspberry Pi +# http://pi-hole.net +# Allows the WebUI to use Pi-hole commands +# +# Pi-hole is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. + +www-data ALL=NOPASSWD: /usr/local/bin/pihole diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 05db1681..8d6fde69 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -638,6 +638,11 @@ installPiholeWeb() { $SUDO cp /etc/.pihole/advanced/index.* /var/www/html/pihole/. $SUDO echo " done!" fi + # Install Sudoer file + echo -n "::: Installing sudoer file..." + $SUDO cp /etc/.pihole/advanced/pihole.sudo /etc/sudoers.d/pihole + $SUDO chmod 0440 /etc/sudoers.d/pihole + echo " done!" } installCron() { diff --git a/automated install/uninstall.sh b/automated install/uninstall.sh index 2d32b52d..83168d6a 100755 --- a/automated install/uninstall.sh +++ b/automated install/uninstall.sh @@ -122,8 +122,9 @@ function removeNoPurge { $SUDO rm -rf /etc/.pihole/ &> /dev/null $SUDO rm -rf /opt/pihole/ &> /dev/null $SUDO rm /usr/local/bin/pihole &> /dev/null - $SUDO rm /etc/bash_completion.d/pihole - + $SUDO rm /etc/bash_completion.d/pihole &> /dev/null + $SUDO rm /etc/sudoers.d/pihole &> /dev/null + echo ":::" printf "::: Finished removing PiHole from your system. Sorry to see you go!\n" printf "::: Reach out to us at https://github.com/pi-hole/pi-hole/issues if you need help\n"