luci-app-mosdns: mosdns.sh: fix logpath reading

This commit is contained in:
sbwml 2022-12-16 01:25:27 +08:00
parent 440a33f541
commit fa19bb05fd
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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
)