Add pause and resume for ad blocker
This commit is contained in:
parent
bd7d8a1536
commit
1c499c9ac7
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue