From fa19bb05fde826c3da9e57aca573641cc7c4f87e Mon Sep 17 00:00:00 2001 From: sbwml <984419930@qq.com> Date: Fri, 16 Dec 2022 01:25:27 +0800 Subject: [PATCH] luci-app-mosdns: mosdns.sh: fix logpath reading --- luci-app-mosdns/Makefile | 2 +- luci-app-mosdns/root/usr/share/mosdns/mosdns.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/luci-app-mosdns/Makefile b/luci-app-mosdns/Makefile index dc11b26..ef0b990 100644 --- a/luci-app-mosdns/Makefile +++ b/luci-app-mosdns/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-mosdns -PKG_VERSION:=1.4.3 +PKG_VERSION:=1.4.4 PKG_RELEASE:=2 LUCI_TITLE:=LuCI Support for mosdns diff --git a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh index 7aef37b..e05d90d 100755 --- a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh +++ b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh @@ -6,7 +6,7 @@ logfile_path() ( uci -q get mosdns.config.logfile else [ ! -f /etc/mosdns/config_custom.yaml ] && exit 1 - cat /etc/mosdns/config_custom.yaml | grep -A 4 log | grep file | awk -F ":" '{print $2}' | sed 's/\"//g;s/ //g' + awk '/^log:/{f=1;next}f==1{if($0~/file:/){print;exit}if($0~/^[^ ]/)exit}' /etc/mosdns/config_custom.yaml | grep -Eo "/[^'\"]+" fi )