From 84bf3aadcd77ce722a28aca49fb8c59661f69561 Mon Sep 17 00:00:00 2001 From: Amily Date: Sat, 7 Mar 2020 00:43:39 +0800 Subject: [PATCH] luci-app-ssr-plus:ssr-ad separate control use (#3592) Co-authored-by: amily --- .../luci-app-ssr-plus/root/etc/init.d/shadowsocksr | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index 9a1023beb9..95e81ca6a9 100755 --- a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -524,6 +524,9 @@ start() { conf-dir=/tmp/dnsmasq.oversea EOF fi + if [ -e "/tmp/dnsmasq.d/ad.conf" ]; then + rm -f /tmp/dnsmasq.d/ad.conf + fi if [ $(uci_get_by_type global adblock 0) == "0" ]; then rm -f /tmp/dnsmasq.ssr/ad.conf fi @@ -579,9 +582,14 @@ stop() { else kill -9 $(busybox ps -w | grep pdnsd | grep -v grep | awk '{print $1}') >/dev/null 2>&1 fi + if [ $(uci_get_by_type global adblock 0) == "0" ]; then + rm -f /tmp/dnsmasq.d/ad.conf + else + cp -f /etc/dnsmasq.ssr/ad.conf /tmp/dnsmasq.d/ad.conf + fi if [ -f "/tmp/dnsmasq.d/dnsmasq-ssr.conf" ]; then rm -f /tmp/dnsmasq.d/dnsmasq-ssr.conf - /etc/init.d/dnsmasq restart >/dev/null 2>&1 fi + /etc/init.d/dnsmasq restart >/dev/null 2>&1 del_cron }