aboutsummaryrefslogtreecommitdiff
path: root/net/adblock/files/adblock.monitor
diff options
context:
space:
mode:
Diffstat (limited to 'net/adblock/files/adblock.monitor')
-rwxr-xr-xnet/adblock/files/adblock.monitor40
1 files changed, 0 insertions, 40 deletions
diff --git a/net/adblock/files/adblock.monitor b/net/adblock/files/adblock.monitor
deleted file mode 100755
index b5b73673d..000000000
--- a/net/adblock/files/adblock.monitor
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-# ubus monitor to trace dns backend events and conditionally restart adblock
-# Copyright (c) 2015-2020 Dirk Brenken (dev@brenken.org)
-# This is free software, licensed under the GNU General Public License v3.
-
-# set (s)hellcheck exceptions
-# shellcheck disable=1091,2010,2016,2034,2039,2059,2086,2091,2129,2143,2154,2181,2183,2188
-
-LC_ALL=C
-PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-
-if [ -r "/lib/functions.sh" ]
-then
- . "/lib/functions.sh"
- adb_dns="$(uci_get adblock global adb_dns)"
-fi
-adb_ver="${1}"
-adb_ubus="$(command -v ubus)"
-adb_logger="$(command -v logger)"
-
-f_log()
-{
- local class="${1}" log_msg="${2}"
-
- if [ -x "${adb_logger}" ]
- then
- "${adb_logger}" -p "${class}" -t "adblock-${adb_ver}[${$}]" "${log_msg}"
- else
- printf "%s %s %s\\n" "${class}" "adblock-${adb_ver}[${$}]" "${log_msg}"
- fi
-}
-
-if [ -x "${adb_ubus}" ] && [ -n "${adb_dns}" ]
-then
- f_log "info" "ubus/adblock monitor started"
- "${adb_ubus}" -S -M r -m invoke monitor | \
- { grep -qE "\"method\":\"(set|signal)\",\"data\":\{\"name\":\"${adb_dns}\""; [ $? -eq 0 ] && /etc/init.d/adblock start; }
-else
- f_log "err" "can't start ubus/adblock monitor"
-fi