From d9135347935d9150443e405b4d0ef92f64c03f63 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 27 May 2017 17:51:41 +0200 Subject: [PATCH] Move wildcards file if blocking is disabled (#1495) * Move wildcards file if blocking is diabled * Delete newline --- pihole | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pihole b/pihole index f89b67b2..1fb985e1 100755 --- a/pihole +++ b/pihole @@ -176,6 +176,9 @@ Time: elif [[ "${1}" == "0" ]]; then # Disable Pi-hole sed -i 's/^addn-hosts=\/etc\/pihole\/gravity.list/#addn-hosts=\/etc\/pihole\/gravity.list/' /etc/dnsmasq.d/01-pihole.conf + if [[ -e "$wildcardlist" ]]; then + mv "$wildcardlist" "/etc/pihole/wildcard.list" + fi echo "::: Blocking has been disabled!" if [[ $# > 1 ]]; then if [[ "${2}" == *"s"* ]]; then @@ -199,6 +202,9 @@ Time: # Enable Pi-hole echo "::: Blocking has been enabled!" sed -i 's/^#addn-hosts/addn-hosts/' /etc/dnsmasq.d/01-pihole.conf + if [[ -e "/etc/pihole/wildcard.list" ]]; then + mv "/etc/pihole/wildcard.list" "$wildcardlist" + fi fi restartDNS } @@ -305,7 +311,7 @@ tricorderFunc() { echo "Please do not call Tricorder directly." exit 1 fi - + if ! timeout 2 nc -z tricorder.pi-hole.net 9998 &> /dev/null; then echo "Unable to connect to Pi-hole's Tricorder server." exit 1