Skip to content

Commit 047d77c

Browse files
committed
_dnsmasq_instance_get_confdir bugfix
1 parent b86d7c4 commit 047d77c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
55

66
PKG_NAME:=adblock-fast
77
PKG_VERSION:=1.2.1
8-
PKG_RELEASE:=8
8+
PKG_RELEASE:=9
99
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
1010
PKG_LICENSE:=AGPL-3.0-or-later
1111

files/etc/init.d/adblock-fast

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,12 +1067,10 @@ load_environment() {
10671067

10681068
resolver() {
10691069
_dnsmasq_instance_get_confdir() {
1070-
local cfg_file
1071-
local instance_name
1072-
1073-
instance_name=$(uci -q show "dhcp.${1}" | awk -F'[.=]' 'NR==1{print $2}')
1070+
local cfg cfg_file
1071+
cfg="$(uci -q show "dhcp.${1}" | awk -F'[.=]' 'NR==1{print $2}')"
10741072
[ -z "$dnsmasq_ubus" ] && dnsmasq_ubus="$(ubus call service list '{"name":"dnsmasq"}')"
1075-
cfg_file="$(echo "$dnsmasq_ubus" | jsonfilter -e "@.dnsmasq.instances.${instance_name}.command" \
1073+
cfg_file="$(echo "$dnsmasq_ubus" | jsonfilter -e "@.dnsmasq.instances.${cfg}.command" \
10761074
| awk '{gsub(/\\\//,"/");gsub(/[][",]/,"");for(i=1;i<=NF;i++)if($i=="-C"){print $(i+1);exit}}')"
10771075
awk -F= '/^conf-dir=/{print $2; exit}' "$cfg_file"
10781076
}

0 commit comments

Comments
 (0)