safe-search: Dynamic Updates

Ensure that the best available IP is always used for all supported
safe-search providers. This is accomplished by periodically checking
DNS for the most recent list of IP addresses associated with each
provider.

Signed-off-by: Gregory L. Dietsche <gregory.dietsche@cuw.edu>
This commit is contained in:
Gregory L. Dietsche 2021-01-11 11:59:46 -06:00 committed by Paul Spooren
parent 0f21ed774c
commit f2837d7470
9 changed files with 936 additions and 462 deletions

View File

@ -1,13 +1,13 @@
#
# Copyright (c) 2018 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
# Copyright (c) 2021 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
# This is free software, licensed under the MIT License
#
include $(TOPDIR)/rules.mk
PKG_NAME:=safe-search
PKG_VERSION:=1.0.2
PKG_RELEASE:=2
PKG_VERSION:=2.0.0
PKG_RELEASE:=1
PKG_LICENSE:=MIT
PKG_MAINTAINER:=Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
@ -44,18 +44,29 @@ define Package/safe-search/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/safe-search-update $(1)/usr/sbin/safe-search-update
$(INSTALL_BIN) ./files/safe-search-maintenance $(1)/usr/sbin/safe-search-maintenance
$(INSTALL_DIR) $(1)/etc/safe-search/enabled
$(INSTALL_DIR) $(1)/etc/safe-search/available
$(INSTALL_DATA) ./files/hosts/* $(1)/etc/safe-search/available/
endef
define Package/safe-search/postinst
#!/bin/sh
if [ -z "$${IPGK_INSTROOT}" ]; then
echo "0 * * * * /bin/nice /usr/sbin/safe-search-maintenance>/dev/null 2>&1">>/etc/crontabs/root
/etc/init.d/cron restart
fi
exit 0
endef
define Package/safe-search/prerm
#!/bin/sh
if [ -z "$${IPGK_INSTROOT}" ]; then
uci del_list dhcp.@dnsmasq[0].addnhosts=/etc/safe-search/enabled
uci commit dhcp
/etc/init.d/dnsmasq reload
crontab -l | grep -v "safe-search-maintenance" | sort | uniq | crontab -
fi
exit 0
endef

View File

@ -1,14 +1,10 @@
#
# Copyright (c) 2018 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
# This is free software, licensed under the MIT License
#
##########################################################################
# **** IMPORTANT **** #
# Do not make changes to this file instead please execute: #
# /usr/sbin/safe-search-maintenance #
# If this file is not working, please ensure dnsmasq is able to READ it! #
##########################################################################
#
# IMPORTANT: if this file is not working, make sure that dnsmasq is able to READ it!
#
#204.79.197.220 strict.bing.com
#::FFFF:CC4F:C5DC strict.bing.com
# Last Updated On: Tue Jan 12 13:42:47 CST 2021
204.79.197.220 bing.com www.bing.com
::FFFF:CC4F:C5DC bing.com www.bing.com

View File

@ -1,12 +1,10 @@
#
# Copyright (c) 2019 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
# This is free software, licensed under the MIT License
#
##########################################################################
# **** IMPORTANT **** #
# Do not make changes to this file instead please execute: #
# /usr/sbin/safe-search-maintenance #
# If this file is not working, please ensure dnsmasq is able to READ it! #
##########################################################################
#
# IMPORTANT: if this file is not working, make sure that dnsmasq is able to READ it!
#
#40.89.244.237 safe.duckduckgo.com
# Last Updated On: Tue Jan 12 13:42:47 CST 2021
40.89.244.237 duckduckgo.com

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,11 @@
#
# Copyright (c) 2018 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
# This is free software, licensed under the MIT License
#
##########################################################################
# **** IMPORTANT **** #
# Do not make changes to this file instead please execute: #
# /usr/sbin/safe-search-maintenance #
# If this file is not working, please ensure dnsmasq is able to READ it! #
##########################################################################
#
# IMPORTANT: if this file is not working, make sure that dnsmasq is able to READ it!
#
# Last Updated On: Tue Jan 12 13:42:47 CST 2021
#216.239.38.120 restrict.youtube.com
#2001:4860:4802:32::78 restrict.youtube.com
#IPv6
2001:4860:4802:32::78 www.youtube.com
2001:4860:4802:32::78 m.youtube.com
2001:4860:4802:32::78 youtubei.googleapis.com
2001:4860:4802:32::78 youtube.googleapis.com
2001:4860:4802:32::78 www.youtube-nocookie.com
#IPv4
216.239.38.120 www.youtube.com
216.239.38.120 m.youtube.com
216.239.38.120 youtubei.googleapis.com
216.239.38.120 youtube.googleapis.com
216.239.38.120 www.youtube-nocookie.com
2001:4860:4802:32::78 www.youtube.com m.youtube.com youtubei.googleapis.com youtube.googleapis.com www.youtube-nocookie.com
216.239.38.120 www.youtube.com m.youtube.com youtubei.googleapis.com youtube.googleapis.com www.youtube-nocookie.com

View File

@ -1,25 +1,11 @@
#
# Copyright (c) 2018 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
# This is free software, licensed under the MIT License
#
##########################################################################
# **** IMPORTANT **** #
# Do not make changes to this file instead please execute: #
# /usr/sbin/safe-search-maintenance #
# If this file is not working, please ensure dnsmasq is able to READ it! #
##########################################################################
#
# IMPORTANT: if this file is not working, make sure that dnsmasq is able to READ it!
#
# Last Updated On: Tue Jan 12 13:42:47 CST 2021
#216.239.38.119 restrictmoderate.youtube.com
#2001:4860:4802:32::77 restrictmoderate.youtube.com
#IPv6
2001:4860:4802:32::77 www.youtube.com
2001:4860:4802:32::77 m.youtube.com
2001:4860:4802:32::77 youtubei.googleapis.com
2001:4860:4802:32::77 youtube.googleapis.com
2001:4860:4802:32::77 www.youtube-nocookie.com
#IPv4
216.239.38.119 www.youtube.com
216.239.38.119 m.youtube.com
216.239.38.119 youtubei.googleapis.com
216.239.38.119 youtube.googleapis.com
216.239.38.119 www.youtube-nocookie.com
2001:4860:4802:32::77 youtube.com m.youtube.com youtubei.googleapis.com youtube.googleapis.com www.youtube-nocookie.com
216.239.38.119 www.youtube.com m.youtube.com youtubei.googleapis.com youtube.googleapis.com www.youtube-nocookie.com

View File

@ -0,0 +1,488 @@
#!/bin/sh
#
# Copyright (c) 2021 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
# This is free software, licensed under the MIT License
#
HasIpAddressChanged() {
# Create a sorted, unique list of addresses using DNS
HOST_LIVE=$(nslookup "$1" | grep "Address\ [0-9]\+:" | sed -r 's/^Address [0-9]+: //' | sort | uniq -i)
# Create a sorted, unique list of addresess currently in use
HOST_SAFE=$(grep -i "^[:0-9a-f]" "$2" | sed 's/ .*//' | sort | uniq -i)
# dns resolution errors / not being connected to the internet can cause this.
if [ -z "$HOST_LIVE" ]; then
return 1
fi
#If the lists do not match, then we want to update to match the DNS records.
if [ "$HOST_LIVE" = "$HOST_SAFE" ]; then
return 1 # IP has NOT changed
fi
return 0 # IP has changed
}
StartIpAddressUpdate(){
echo Updating "$1"
RELOAD_DNSMASQ=1
#Create the new hosts file...
cat >"$1"<<EOL
##########################################################################
# **** IMPORTANT **** #
# Do not make changes to this file instead please execute: #
# /usr/sbin/safe-search-maintenance #
# If this file is not working, please ensure dnsmasq is able to READ it! #
##########################################################################
# Last Updated On: $(date)
EOL
}
MakeHost(){
for ipAddr in $HOST_LIVE
do
echo "$ipAddr $1"
done
}
#################################################
### strict.bing.com ###
#################################################
HOST_FILE=/etc/safe-search/available/bing.default
if HasIpAddressChanged strict.bing.com $HOST_FILE; then
StartIpAddressUpdate $HOST_FILE
MakeHost "bing.com www.bing.com">>$HOST_FILE
fi
#################################################
### safe.duckduckgo.com ###
#################################################
HOST_FILE=/etc/safe-search/available/duckduckgo.default
if HasIpAddressChanged safe.duckduckgo.com $HOST_FILE; then
StartIpAddressUpdate $HOST_FILE
MakeHost "duckduckgo.com">>$HOST_FILE
fi
#################################################
### restrict.youtube.com ###
#################################################
HOST_FILE=/etc/safe-search/available/youtube.restrict
if HasIpAddressChanged restrict.youtube.com $HOST_FILE; then
StartIpAddressUpdate $HOST_FILE
MakeHost "www.youtube.com m.youtube.com youtubei.googleapis.com youtube.googleapis.com www.youtube-nocookie.com">>$HOST_FILE
fi
#################################################
### restrictmoderate.youtube.com ###
#################################################
HOST_FILE=/etc/safe-search/available/youtube.restrictmoderate
if HasIpAddressChanged restrictmoderate.youtube.com $HOST_FILE; then
StartIpAddressUpdate $HOST_FILE
MakeHost "www.youtube.com m.youtube.com youtubei.googleapis.com youtube.googleapis.com www.youtube-nocookie.com">>$HOST_FILE
fi
#################################################
### forcesafesearch.google.com ###
### https://www.google.com/supported_domains ###
#################################################
HOST_FILE=/etc/safe-search/available/google.default
if HasIpAddressChanged forcesafesearch.google.com $HOST_FILE; then
StartIpAddressUpdate $HOST_FILE
cat >>"$HOST_FILE"<<EOL
$(MakeHost "google.com")
$(MakeHost "google.ad")
$(MakeHost "google.ae")
$(MakeHost "google.com.af")
$(MakeHost "google.com.ag")
$(MakeHost "google.com.ai")
$(MakeHost "google.al")
$(MakeHost "google.am")
$(MakeHost "google.co.ao")
$(MakeHost "google.com.ar")
$(MakeHost "google.as")
$(MakeHost "google.at")
$(MakeHost "google.com.au")
$(MakeHost "google.az")
$(MakeHost "google.ba")
$(MakeHost "google.com.bd")
$(MakeHost "google.be")
$(MakeHost "google.bf")
$(MakeHost "google.bg")
$(MakeHost "google.com.bh")
$(MakeHost "google.bi")
$(MakeHost "google.bj")
$(MakeHost "google.com.bn")
$(MakeHost "google.com.bo")
$(MakeHost "google.com.br")
$(MakeHost "google.bs")
$(MakeHost "google.bt")
$(MakeHost "google.co.bw")
$(MakeHost "google.by")
$(MakeHost "google.com.bz")
$(MakeHost "google.ca")
$(MakeHost "google.cd")
$(MakeHost "google.cf")
$(MakeHost "google.cg")
$(MakeHost "google.ch")
$(MakeHost "google.ci")
$(MakeHost "google.co.ck")
$(MakeHost "google.cl")
$(MakeHost "google.cm")
$(MakeHost "google.cn")
$(MakeHost "google.com.co")
$(MakeHost "google.co.cr")
$(MakeHost "google.com.cu")
$(MakeHost "google.cv")
$(MakeHost "google.com.cy")
$(MakeHost "google.cz")
$(MakeHost "google.de")
$(MakeHost "google.dj")
$(MakeHost "google.dk")
$(MakeHost "google.dm")
$(MakeHost "google.com.do")
$(MakeHost "google.dz")
$(MakeHost "google.com.ec")
$(MakeHost "google.ee")
$(MakeHost "google.com.eg")
$(MakeHost "google.es")
$(MakeHost "google.com.et")
$(MakeHost "google.fi")
$(MakeHost "google.com.fj")
$(MakeHost "google.fm")
$(MakeHost "google.fr")
$(MakeHost "google.ga")
$(MakeHost "google.ge")
$(MakeHost "google.gg")
$(MakeHost "google.com.gh")
$(MakeHost "google.com.gi")
$(MakeHost "google.gl")
$(MakeHost "google.gm")
$(MakeHost "google.gp")
$(MakeHost "google.gr")
$(MakeHost "google.com.gt")
$(MakeHost "google.gy")
$(MakeHost "google.com.hk")
$(MakeHost "google.hn")
$(MakeHost "google.hr")
$(MakeHost "google.ht")
$(MakeHost "google.hu")
$(MakeHost "google.co.id")
$(MakeHost "google.ie")
$(MakeHost "google.co.il")
$(MakeHost "google.im")
$(MakeHost "google.co.in")
$(MakeHost "google.iq")
$(MakeHost "google.is")
$(MakeHost "google.it")
$(MakeHost "google.je")
$(MakeHost "google.com.jm")
$(MakeHost "google.jo")
$(MakeHost "google.co.jp")
$(MakeHost "google.co.ke")
$(MakeHost "google.com.kh")
$(MakeHost "google.ki")
$(MakeHost "google.kg")
$(MakeHost "google.co.kr")
$(MakeHost "google.com.kw")
$(MakeHost "google.kz")
$(MakeHost "google.la")
$(MakeHost "google.com.lb")
$(MakeHost "google.li")
$(MakeHost "google.lk")
$(MakeHost "google.co.ls")
$(MakeHost "google.lt")
$(MakeHost "google.lu")
$(MakeHost "google.lv")
$(MakeHost "google.com.ly")
$(MakeHost "google.co.ma")
$(MakeHost "google.md")
$(MakeHost "google.me")
$(MakeHost "google.mg")
$(MakeHost "google.mk")
$(MakeHost "google.ml")
$(MakeHost "google.com.mm")
$(MakeHost "google.mn")
$(MakeHost "google.ms")
$(MakeHost "google.com.mt")
$(MakeHost "google.mu")
$(MakeHost "google.mv")
$(MakeHost "google.mw")
$(MakeHost "google.com.mx")
$(MakeHost "google.com.my")
$(MakeHost "google.co.mz")
$(MakeHost "google.com.na")
$(MakeHost "google.com.nf")
$(MakeHost "google.com.ng")
$(MakeHost "google.com.ni")
$(MakeHost "google.ne")
$(MakeHost "google.nl")
$(MakeHost "google.no")
$(MakeHost "google.com.np")
$(MakeHost "google.nr")
$(MakeHost "google.nu")
$(MakeHost "google.co.nz")
$(MakeHost "google.com.om")
$(MakeHost "google.com.pa")
$(MakeHost "google.com.pe")
$(MakeHost "google.com.pg")
$(MakeHost "google.com.ph")
$(MakeHost "google.com.pk")
$(MakeHost "google.pl")
$(MakeHost "google.pn")
$(MakeHost "google.com.pr")
$(MakeHost "google.ps")
$(MakeHost "google.pt")
$(MakeHost "google.com.py")
$(MakeHost "google.com.qa")
$(MakeHost "google.ro")
$(MakeHost "google.ru")
$(MakeHost "google.rw")
$(MakeHost "google.com.sa")
$(MakeHost "google.com.sb")
$(MakeHost "google.sc")
$(MakeHost "google.se")
$(MakeHost "google.com.sg")
$(MakeHost "google.sh")
$(MakeHost "google.si")
$(MakeHost "google.sk")
$(MakeHost "google.com.sl")
$(MakeHost "google.sn")
$(MakeHost "google.so")
$(MakeHost "google.sm")
$(MakeHost "google.sr")
$(MakeHost "google.st")
$(MakeHost "google.com.sv")
$(MakeHost "google.td")
$(MakeHost "google.tg")
$(MakeHost "google.co.th")
$(MakeHost "google.com.tj")
$(MakeHost "google.tk")
$(MakeHost "google.tl")
$(MakeHost "google.tm")
$(MakeHost "google.tn")
$(MakeHost "google.to")
$(MakeHost "google.com.tr")
$(MakeHost "google.tt")
$(MakeHost "google.com.tw")
$(MakeHost "google.co.tz")
$(MakeHost "google.com.ua")
$(MakeHost "google.co.ug")
$(MakeHost "google.co.uk")
$(MakeHost "google.com.uy")
$(MakeHost "google.co.uz")
$(MakeHost "google.com.vc")
$(MakeHost "google.co.ve")
$(MakeHost "google.vg")
$(MakeHost "google.co.vi")
$(MakeHost "google.com.vn")
$(MakeHost "google.vu")
$(MakeHost "google.ws")
$(MakeHost "google.rs")
$(MakeHost "google.co.za")
$(MakeHost "google.co.zm")
$(MakeHost "google.co.zw")
$(MakeHost "google.cat")
$(MakeHost "www.google.com")
$(MakeHost "www.google.ad")
$(MakeHost "www.google.ae")
$(MakeHost "www.google.com.af")
$(MakeHost "www.google.com.ag")
$(MakeHost "www.google.com.ai")
$(MakeHost "www.google.al")
$(MakeHost "www.google.am")
$(MakeHost "www.google.co.ao")
$(MakeHost "www.google.com.ar")
$(MakeHost "www.google.as")
$(MakeHost "www.google.at")
$(MakeHost "www.google.com.au")
$(MakeHost "www.google.az")
$(MakeHost "www.google.ba")
$(MakeHost "www.google.com.bd")
$(MakeHost "www.google.be")
$(MakeHost "www.google.bf")
$(MakeHost "www.google.bg")
$(MakeHost "www.google.com.bh")
$(MakeHost "www.google.bi")
$(MakeHost "www.google.bj")
$(MakeHost "www.google.com.bn")
$(MakeHost "www.google.com.bo")
$(MakeHost "www.google.com.br")
$(MakeHost "www.google.bs")
$(MakeHost "www.google.bt")
$(MakeHost "www.google.co.bw")
$(MakeHost "www.google.by")
$(MakeHost "www.google.com.bz")
$(MakeHost "www.google.ca")
$(MakeHost "www.google.cd")
$(MakeHost "www.google.cf")
$(MakeHost "www.google.cg")
$(MakeHost "www.google.ch")
$(MakeHost "www.google.ci")
$(MakeHost "www.google.co.ck")
$(MakeHost "www.google.cl")
$(MakeHost "www.google.cm")
$(MakeHost "www.google.cn")
$(MakeHost "www.google.com.co")
$(MakeHost "www.google.co.cr")
$(MakeHost "www.google.com.cu")
$(MakeHost "www.google.cv")
$(MakeHost "www.google.com.cy")
$(MakeHost "www.google.cz")
$(MakeHost "www.google.de")
$(MakeHost "www.google.dj")
$(MakeHost "www.google.dk")
$(MakeHost "www.google.dm")
$(MakeHost "www.google.com.do")
$(MakeHost "www.google.dz")
$(MakeHost "www.google.com.ec")
$(MakeHost "www.google.ee")
$(MakeHost "www.google.com.eg")
$(MakeHost "www.google.es")
$(MakeHost "www.google.com.et")
$(MakeHost "www.google.fi")
$(MakeHost "www.google.com.fj")
$(MakeHost "www.google.fm")
$(MakeHost "www.google.fr")
$(MakeHost "www.google.ga")
$(MakeHost "www.google.ge")
$(MakeHost "www.google.gg")
$(MakeHost "www.google.com.gh")
$(MakeHost "www.google.com.gi")
$(MakeHost "www.google.gl")
$(MakeHost "www.google.gm")
$(MakeHost "www.google.gp")
$(MakeHost "www.google.gr")
$(MakeHost "www.google.com.gt")
$(MakeHost "www.google.gy")
$(MakeHost "www.google.com.hk")
$(MakeHost "www.google.hn")
$(MakeHost "www.google.hr")
$(MakeHost "www.google.ht")
$(MakeHost "www.google.hu")
$(MakeHost "www.google.co.id")
$(MakeHost "www.google.ie")
$(MakeHost "www.google.co.il")
$(MakeHost "www.google.im")
$(MakeHost "www.google.co.in")
$(MakeHost "www.google.iq")
$(MakeHost "www.google.is")
$(MakeHost "www.google.it")
$(MakeHost "www.google.je")
$(MakeHost "www.google.com.jm")
$(MakeHost "www.google.jo")
$(MakeHost "www.google.co.jp")
$(MakeHost "www.google.co.ke")
$(MakeHost "www.google.com.kh")
$(MakeHost "www.google.ki")
$(MakeHost "www.google.kg")
$(MakeHost "www.google.co.kr")
$(MakeHost "www.google.com.kw")
$(MakeHost "www.google.kz")
$(MakeHost "www.google.la")
$(MakeHost "www.google.com.lb")
$(MakeHost "www.google.li")
$(MakeHost "www.google.lk")
$(MakeHost "www.google.co.ls")
$(MakeHost "www.google.lt")
$(MakeHost "www.google.lu")
$(MakeHost "www.google.lv")
$(MakeHost "www.google.com.ly")
$(MakeHost "www.google.co.ma")
$(MakeHost "www.google.md")
$(MakeHost "www.google.me")
$(MakeHost "www.google.mg")
$(MakeHost "www.google.mk")
$(MakeHost "www.google.ml")
$(MakeHost "www.google.com.mm")
$(MakeHost "www.google.mn")
$(MakeHost "www.google.ms")
$(MakeHost "www.google.com.mt")
$(MakeHost "www.google.mu")
$(MakeHost "www.google.mv")
$(MakeHost "www.google.mw")
$(MakeHost "www.google.com.mx")
$(MakeHost "www.google.com.my")
$(MakeHost "www.google.co.mz")
$(MakeHost "www.google.com.na")
$(MakeHost "www.google.com.nf")
$(MakeHost "www.google.com.ng")
$(MakeHost "www.google.com.ni")
$(MakeHost "www.google.ne")
$(MakeHost "www.google.nl")
$(MakeHost "www.google.no")
$(MakeHost "www.google.com.np")
$(MakeHost "www.google.nr")
$(MakeHost "www.google.nu")
$(MakeHost "www.google.co.nz")
$(MakeHost "www.google.com.om")
$(MakeHost "www.google.com.pa")
$(MakeHost "www.google.com.pe")
$(MakeHost "www.google.com.pg")
$(MakeHost "www.google.com.ph")
$(MakeHost "www.google.com.pk")
$(MakeHost "www.google.pl")
$(MakeHost "www.google.pn")
$(MakeHost "www.google.com.pr")
$(MakeHost "www.google.ps")
$(MakeHost "www.google.pt")
$(MakeHost "www.google.com.py")
$(MakeHost "www.google.com.qa")
$(MakeHost "www.google.ro")
$(MakeHost "www.google.ru")
$(MakeHost "www.google.rw")
$(MakeHost "www.google.com.sa")
$(MakeHost "www.google.com.sb")
$(MakeHost "www.google.sc")
$(MakeHost "www.google.se")
$(MakeHost "www.google.com.sg")
$(MakeHost "www.google.sh")
$(MakeHost "www.google.si")
$(MakeHost "www.google.sk")
$(MakeHost "www.google.com.sl")
$(MakeHost "www.google.sn")
$(MakeHost "www.google.so")
$(MakeHost "www.google.sm")
$(MakeHost "www.google.sr")
$(MakeHost "www.google.st")
$(MakeHost "www.google.com.sv")
$(MakeHost "www.google.td")
$(MakeHost "www.google.tg")
$(MakeHost "www.google.co.th")
$(MakeHost "www.google.com.tj")
$(MakeHost "www.google.tk")
$(MakeHost "www.google.tl")
$(MakeHost "www.google.tm")
$(MakeHost "www.google.tn")
$(MakeHost "www.google.to")
$(MakeHost "www.google.com.tr")
$(MakeHost "www.google.tt")
$(MakeHost "www.google.com.tw")
$(MakeHost "www.google.co.tz")
$(MakeHost "www.google.com.ua")
$(MakeHost "www.google.co.ug")
$(MakeHost "www.google.co.uk")
$(MakeHost "www.google.com.uy")
$(MakeHost "www.google.co.uz")
$(MakeHost "www.google.com.vc")
$(MakeHost "www.google.co.ve")
$(MakeHost "www.google.vg")
$(MakeHost "www.google.co.vi")
$(MakeHost "www.google.com.vn")
$(MakeHost "www.google.vu")
$(MakeHost "www.google.ws")
$(MakeHost "www.google.rs")
$(MakeHost "www.google.co.za")
$(MakeHost "www.google.co.zm")
$(MakeHost "www.google.co.zw")
$(MakeHost "www.google.cat")
EOL
fi
if [ "$RELOAD_DNSMASQ" = "1" ]; then
echo reloading dnsmasq to activate new IP addresses.
/etc/init.d/dnsmasq reload
fi

View File

@ -16,5 +16,5 @@ config safe-search 'google'
# Valid modes for youtube are restrict and restrictmoderate
config safe-search 'youtube'
option enabled 0
option mode 'restrict'
option enabled 0

View File

@ -1,13 +1,14 @@
#!/bin/sh
#
# Copyright (c) 2018 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
# Copyright (c) 2021 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
# This is free software, licensed under the MIT License
#
uci del_list dhcp.@dnsmasq[0].addnhosts=/etc/safe-search/enabled
uci add_list dhcp.@dnsmasq[0].addnhosts=/etc/safe-search/enabled
uci commit dhcp
#/etc/init.d/dnsmasq reload #safe-search-update does this for us.
/usr/sbin/safe-search-maintenance
/usr/sbin/safe-search-update
#/etc/init.d/dnsmasq reload #safe-search-update does this for us.
exit 0