Pi-hole checkout feature

This commit is contained in:
DL6ER
2017-03-08 13:16:40 +01:00
parent e0e9ebbe74
commit 8a14a63d5d
3 changed files with 172 additions and 3 deletions

10
pihole
View File

@@ -8,9 +8,8 @@
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
readonly PI_HOLE_SCRIPT_DIR="/opt/pihole"
PI_HOLE_SCRIPT_DIR="/opt/pihole"
readonly wildcardlist="/etc/dnsmasq.d/03-pihole-wildcard.conf"
# Must be root to use this tool
if [[ ! $EUID -eq 0 ]];then
@@ -280,6 +279,11 @@ tailFunc() {
exit 0
}
piholeCheckoutFunc() {
source "${PI_HOLE_SCRIPT_DIR}"/piholeCheckout.sh
checkout "$@"
}
helpFunc() {
cat << EOM
::: Control all PiHole specific functions!
@@ -313,6 +317,7 @@ helpFunc() {
::: Blocking can also be disabled only temporarily, e.g.,
::: 'pihole disable 5m' - will disable blocking for 5 minutes
::: restartdns Restart dnsmasq
::: checkout Check out different branches
EOM
exit 0
}
@@ -343,5 +348,6 @@ case "${1}" in
"restartdns" ) restartDNS;;
"-a" | "admin" ) webpageFunc "$@";;
"-t" | "tail" ) tailFunc;;
"checkout" ) piholeCheckoutFunc "$@";;
* ) helpFunc;;
esac