mirror of
https://github.com/openwrt/packages.git
synced 2025-12-22 14:44:36 +04:00
adblock-fast: bugfix: dnsmasq instances confdir hack
* temporary hack until https://github.com/openwrt/openwrt/pull/16806 is merged Signed-off-by: Stan Grishin <stangri@melmac.ca>
This commit is contained in:
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=adblock-fast
|
PKG_NAME:=adblock-fast
|
||||||
PKG_VERSION:=1.1.2
|
PKG_VERSION:=1.1.2
|
||||||
PKG_RELEASE:=16
|
PKG_RELEASE:=18
|
||||||
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
|
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
|
||||||
PKG_LICENSE:=AGPL-3.0-or-later
|
PKG_LICENSE:=AGPL-3.0-or-later
|
||||||
|
|
||||||
|
|||||||
@@ -854,7 +854,12 @@ resolver() {
|
|||||||
uci_add_list_if_new 'dhcp' "$cfg" 'addnhosts' "$dnsmasqAddnhostsFile"
|
uci_add_list_if_new 'dhcp' "$cfg" 'addnhosts' "$dnsmasqAddnhostsFile"
|
||||||
;;
|
;;
|
||||||
cleanup|unbound.adb_list)
|
cleanup|unbound.adb_list)
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
if grep -q 'config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq${cfg:+.$cfg}.d"' '/etc/init.d/dnsmasq'; then
|
||||||
|
config_get confdir "$cfg" 'confdir' "/tmp/dnsmasq${cfg:+.$cfg}.d"
|
||||||
|
else
|
||||||
config_get confdir "$cfg" 'confdir' '/tmp/dnsmasq.d'
|
config_get confdir "$cfg" 'confdir' '/tmp/dnsmasq.d'
|
||||||
|
fi
|
||||||
rm -f "${confdir}/${dnsmasqConfFile}" "${confdir}/${dnsmasqIpsetFile}" "${confdir}/${dnsmasqNftsetFile}"
|
rm -f "${confdir}/${dnsmasqConfFile}" "${confdir}/${dnsmasqIpsetFile}" "${confdir}/${dnsmasqNftsetFile}"
|
||||||
uci_remove_list 'dhcp' "$cfg" 'addnhosts' "$dnsmasqAddnhostsFile"
|
uci_remove_list 'dhcp' "$cfg" 'addnhosts' "$dnsmasqAddnhostsFile"
|
||||||
if [ "$(uci_get 'dhcp' "$cfg" 'serversfile')" = "$dnsmasqServersFile" ]; then
|
if [ "$(uci_get 'dhcp' "$cfg" 'serversfile')" = "$dnsmasqServersFile" ]; then
|
||||||
@@ -875,13 +880,17 @@ resolver() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
# shellcheck disable=SC2317
|
# shellcheck disable=SC2016,SC2317
|
||||||
_dnsmasq_instance_init() {
|
_dnsmasq_instance_init() {
|
||||||
local cfg="$1" param="$2" confdir confdirFile
|
local cfg="$1" param="$2" confdir confdirFile
|
||||||
[ -s "/etc/config/dhcp" ] || return 0
|
[ -s "/etc/config/dhcp" ] || return 0
|
||||||
case "$param" in
|
case "$param" in
|
||||||
dnsmasq.conf|dnsmasq.ipset|dnsmasq.nftset)
|
dnsmasq.conf|dnsmasq.ipset|dnsmasq.nftset)
|
||||||
|
if grep -q 'config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq${cfg:+.$cfg}.d"' '/etc/init.d/dnsmasq'; then
|
||||||
|
config_get confdir "$cfg" 'confdir' "/tmp/dnsmasq${cfg:+.$cfg}.d"
|
||||||
|
else
|
||||||
config_get confdir "$cfg" 'confdir' '/tmp/dnsmasq.d'
|
config_get confdir "$cfg" 'confdir' '/tmp/dnsmasq.d'
|
||||||
|
fi
|
||||||
confdirFile="${confdir}/${outputFile}"
|
confdirFile="${confdir}/${outputFile}"
|
||||||
if ! str_contains "$outputDnsmasqFileList" "$confdirFile"; then
|
if ! str_contains "$outputDnsmasqFileList" "$confdirFile"; then
|
||||||
outputDnsmasqFileList="${outputDnsmasqFileList:+$outputDnsmasqFileList }${confdirFile}"
|
outputDnsmasqFileList="${outputDnsmasqFileList:+$outputDnsmasqFileList }${confdirFile}"
|
||||||
|
|||||||
Reference in New Issue
Block a user