Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move wildcards file if blocking is disabled #1495

Merged
merged 2 commits into from May 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion pihole
Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand Down