* add support for 'DNS File Reset', where the final DNS blockfile
will be purged after DNS backend loading (save storage space).
A small background service will be started to trace/handle
dns backend reloads/restarts
* add support for the 'null' blocking variant in dnsmasq
(via addn-hosts), which may provide better response times
in dnsmasq
* enhance the report & search engine to support
the new blocking variants. Search now includes
backups & black-/whitelist as well
* compressed source list backups are now mandatory (default to '/tmp')
* speed up TLD compression
* E-Mail notification setup is now integrated in UCI/LuCI
* update the LuCI frontend to reflect all changes (separate PR)
* drop preliminary dnscrypt-proxy-support (use dnsmasq instead)
* drop additional 'dnsjail' blocklist support (not used by anyone)
* procd cleanups in init
* various shellcheck cleanups
* update readme
Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 504412ccdb
)
27 lines
976 B
Desktop File
Executable file
27 lines
976 B
Desktop File
Executable file
#!/bin/sh
|
|
# ubus monitor to trace dns backend events and conditionally restart adblock
|
|
# written by Dirk Brenken (dev@brenken.org)
|
|
|
|
# This is free software, licensed under the GNU General Public License v3.
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
LC_ALL=C
|
|
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
|
|
|
if [ -r "/lib/functions.sh" ]
|
|
then
|
|
. "/lib/functions.sh"
|
|
adb_basever="$(uci_get adblock global adb_basever)"
|
|
adb_dns="$(uci_get adblock global adb_dns)"
|
|
fi
|
|
adb_ubus="$(command -v ubus)"
|
|
|
|
if [ -x "${adb_ubus}" ] && [ -n "${adb_dns}" ]
|
|
then
|
|
logger -p "info" -t "adblock-${adb_basever} [${$}]" "ubus/adblock service started"
|
|
"${adb_ubus}" -S -M r -m invoke monitor | \
|
|
{ grep -qF "\"method\":\"set\",\"data\":{\"name\":\"${adb_dns}\""; [ $? -eq 0 ] && /etc/init.d/adblock start; }
|
|
else
|
|
logger -p "err" -t "adblock-${adb_basever} [${$}]" "can't start ubus/adblock service"
|
|
fi
|