From 1c499c9ac7cc468c59daa283beab4c3de8f36466 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 30 Oct 2016 11:47:09 +0000 Subject: [PATCH] Add pause and resume for ad blocker --- src/freedombone-app-pihole | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/freedombone-app-pihole b/src/freedombone-app-pihole index 0b85f75f..1c4210af 100755 --- a/src/freedombone-app-pihole +++ b/src/freedombone-app-pihole @@ -211,6 +211,18 @@ function configure_firewall_for_pihole { mark_completed $FUNCNAME } +function pihole_pause { + pihole disable + dialog --title $"Pause Ad Blocker" \ + --msgbox $"Ad blocking is paused" 6 60 +} + +function pihole_resume { + pihole enable + dialog --title $"Resume Ad Blocker" \ + --msgbox $"Ad blocking has resumed" 6 60 +} + function configure_interactive_pihole { while true do @@ -218,12 +230,14 @@ function configure_interactive_pihole { trap "rm -f $data" 0 1 2 5 15 dialog --backtitle $"Freedombone Control Panel" \ --title $"Ad Blocker" \ - --radiolist $"Choose an operation:" 14 70 5 \ + --radiolist $"Choose an operation:" 16 70 7 \ 1 $"Edit ads list" off \ 2 $"Edit blacklisted domain names" off \ 3 $"Edit whitelisted domain names" off \ 4 $"Change upstream DNS servers" off \ - 5 $"Exit" on 2> $data + 5 $"Pause blocker" off \ + 6 $"Resume blocker" off \ + 7 $"Exit" on 2> $data sel=$? case $sel in 1) exit 1;; @@ -242,7 +256,11 @@ function configure_interactive_pihole { 4) pihole_change_upstream_dns update_pihole_interactive ;; - 5) break;; + 5) pihole_pause + ;; + 6) pihole_resume + ;; + 7) break;; esac done }