From 51123e795185bfabef97e510378dcac17e731d96 Mon Sep 17 00:00:00 2001 From: sbwml <984419930@qq.com> Date: Fri, 24 Mar 2023 22:06:52 +0800 Subject: [PATCH] luci-app-mosdns: init.d: fix error reading `local_dns` when `custom_local_dns` is not enabled fix #61 --- luci-app-mosdns/root/etc/init.d/mosdns | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-mosdns/root/etc/init.d/mosdns b/luci-app-mosdns/root/etc/init.d/mosdns index 0786f89..264640f 100755 --- a/luci-app-mosdns/root/etc/init.d/mosdns +++ b/luci-app-mosdns/root/etc/init.d/mosdns @@ -60,11 +60,11 @@ init_yaml() { s,maximum_ttl_custom,$maximum_ttl_custom,g; \ s,adblock,$adlist,g;s,remote_dns_pipeline,$enable_pipeline,g" \ /usr/share/mosdns/default.yaml > $CONF - [ "$custom_local_dns" -eq 0 ] && sed -i "/bootstrap/d" $CONF || \ echo "${local_dns}" > $tmpdir/local_dns.txt echo "${remote_dns}" > $tmpdir/remote_dns.txt sed -i -e '/- addr: local_dns/{r '$tmpdir/local_dns.txt -e';d};/- addr: remote_dns/{r '$tmpdir/remote_dns.txt -e';d}' \ $CONF + [ "$custom_local_dns" -eq 0 ] && sed -i "/bootstrap/d" $CONF rm -rf $tmpdir }