From f79fef179ebf673cacfd39a15512d55fc0994b06 Mon Sep 17 00:00:00 2001 From: larsonzh Date: Sat, 12 Nov 2022 13:49:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8DOpenWrt=E2=80=9CDHCP/DNS-IP?= =?UTF-8?q?=E9=9B=86=E2=80=9D=E9=85=8D=E7=BD=AE=E4=B8=AD=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?IP=E9=9B=86=E4=BD=BF=E7=94=A8=E5=90=8C=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E5=88=97=E8=A1=A8=E6=97=B6=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- release/lzrules/lzrules.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/release/lzrules/lzrules.sh b/release/lzrules/lzrules.sh index 817673c..0b6cdbe 100644 --- a/release/lzrules/lzrules.sh +++ b/release/lzrules/lzrules.sh @@ -1,5 +1,5 @@ #!/bin/sh -# lzrules.sh v1.0.6 +# lzrules.sh v1.0.7 # By LZ 妙妙呜 (larsonzhang@gmail.com) # LZ RULES script for OpenWrt based router @@ -209,7 +209,7 @@ CUSTOM_IPSETS_LST="" DNAME_IPSETS_LST="" # 版本号 -LZ_VERSION=v1.0.6 +LZ_VERSION=v1.0.7 # 项目标识 PROJECT_ID="lzrules" @@ -566,7 +566,7 @@ print_wan_ispip_item_num() { local buf="" for name in ${DNAME_IPSETS_LST} do - buf="$( uci show "${HOST_DHCP_FILENAME}" 2> /dev/null | awk -F '.' '$0 ~ "'"name=\'${name}\'"'" {print $2}' )" + buf="$( uci show "${HOST_DHCP_FILENAME}" 2> /dev/null | awk -F '.' '$2 ~ /^@ipset/ && $3 ~ "'"^name=.*\'${name}\'"'" {print $2}' )" [ -n "${buf}" ] && buf="$( uci get "${HOST_DHCP_FILENAME}.${buf}.domain" 2> /dev/null | awk '{print NF; exit}' )" [ -z "${buf}" ] && buf="0" num="$( get_ipset_total "${name}" )" @@ -640,7 +640,7 @@ load_ipsets() { [ -n "${DNAME_IPSETS_LST}" ] && /etc/init.d/dnsmasq restart > /dev/null 2>&1 for name in ${DNAME_IPSETS_LST} do - buf="$( uci show "${HOST_DHCP_FILENAME}" 2> /dev/null | awk -F '.' '$0 ~ "'"name=\'${name}\'"'" {print $2}' )" + buf="$( uci show "${HOST_DHCP_FILENAME}" 2> /dev/null | awk -F '.' '$2 ~ /^@ipset/ && $3 ~ "'"^name=.*\'${name}\'"'" {print $2}' )" [ -n "${buf}" ] && uci get "${HOST_DHCP_FILENAME}.${buf}.domain" 2> /dev/null \ | sed -e 's/[ \t][ \t]*/\n/g' -e '/^[ \t]*$/d' \ | awk '{system("nslookup -type=a "$1" > /dev/null 2>&1")}'