Add pause and resume for ad blocker

This commit is contained in:
Bob Mottram 2016-10-30 11:47:09 +00:00
parent bd7d8a1536
commit 1c499c9ac7
1 changed files with 21 additions and 3 deletions

View File

@ -211,6 +211,18 @@ function configure_firewall_for_pihole {
mark_completed $FUNCNAME 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 { function configure_interactive_pihole {
while true while true
do do
@ -218,12 +230,14 @@ function configure_interactive_pihole {
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone Control Panel" \ dialog --backtitle $"Freedombone Control Panel" \
--title $"Ad Blocker" \ --title $"Ad Blocker" \
--radiolist $"Choose an operation:" 14 70 5 \ --radiolist $"Choose an operation:" 16 70 7 \
1 $"Edit ads list" off \ 1 $"Edit ads list" off \
2 $"Edit blacklisted domain names" off \ 2 $"Edit blacklisted domain names" off \
3 $"Edit whitelisted domain names" off \ 3 $"Edit whitelisted domain names" off \
4 $"Change upstream DNS servers" 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=$? sel=$?
case $sel in case $sel in
1) exit 1;; 1) exit 1;;
@ -242,7 +256,11 @@ function configure_interactive_pihole {
4) pihole_change_upstream_dns 4) pihole_change_upstream_dns
update_pihole_interactive update_pihole_interactive
;; ;;
5) break;; 5) pihole_pause
;;
6) pihole_resume
;;
7) break;;
esac esac
done done
} }