Merge pull request #1310 from pi-hole/new/piholecheckout

Pi-hole checkout feature
This commit is contained in:
DL6ER
2017-03-09 00:43:35 +01:00
committed by DL6ER
parent 051f463350
commit 9a95531fb9
3 changed files with 173 additions and 3 deletions
+9 -2
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
@@ -278,6 +277,12 @@ tailFunc() {
exit 0
}
piholeCheckoutFunc() {
source "${PI_HOLE_SCRIPT_DIR}"/piholeCheckout.sh
shift
checkout "$@"
}
helpFunc() {
cat << EOM
::: Control all PiHole specific functions!
@@ -311,6 +316,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
}
@@ -341,5 +347,6 @@ case "${1}" in
"restartdns" ) restartDNS;;
"-a" | "admin" ) webpageFunc "$@";;
"-t" | "tail" ) tailFunc;;
"checkout" ) piholeCheckoutFunc "$@";;
* ) helpFunc;;
esac