Browse Source

luci-app-ssr-plus: Fix wrong path is:`/dnsmasq-ssrplus.d/gfw_list.conf`.

Fixed: https://github.com/fw876/helloworld/commit/8f3b7ea66cdb9fa36f8468de330c65be3cd383a7

Signed-off-by: Zxl hhyccc <[email protected]>
zxlhhyccc 11 months ago
parent
commit
2278b99c93

+ 4 - 4
luci-app-ssr-plus/root/etc/init.d/shadowsocksr

@@ -17,13 +17,13 @@ LOCK_FILE=/var/lock/ssrplus.lock
 LOG_FILE=/var/log/ssrplus.log
 TMP_PATH=/var/etc/ssrplus
 TMP_BIN_PATH=$TMP_PATH/bin
-# Get the default DNSMasq config ID from the UCI configuration
+# 获取默认的 DNSMasq 配置 ID
 DEFAULT_DNSMASQ_CFGID=$(uci show dhcp.@dnsmasq[0] | awk -F '.' '{print $2}' | awk -F '=' '{print $1}' | head -1)
-# Locate the dnsmasq.conf file that contains the conf-dir option
+# 查找包含 conf-dir 选项的 dnsmasq.conf 文件路径
 DNSMASQ_CONF_PATH=$(grep -l "^conf-dir=" "/tmp/etc/dnsmasq.conf.${DEFAULT_DNSMASQ_CFGID}")
-# Extract the directory path from the conf-dir line
+# 从 conf-dir 行中提取目录路径
 DNSMASQ_CONF_DIR=$(grep '^conf-dir=' "$DNSMASQ_CONF_PATH" | cut -d'=' -f2 | head -n 1)
-# Check if a conf-dir value was found and set variables accordingly
+# 设置 TMP_DNSMASQ_PATH,并去除路径末尾的斜杠
 TMP_DNSMASQ_PATH=${DNSMASQ_CONF_DIR%*/}/dnsmasq-ssrplus.d
 
 chain_config_file=		   #generate shadowtls chain proxy config file

+ 1 - 2
luci-app-ssr-plus/root/usr/share/shadowsocksr/update.lua

@@ -9,8 +9,7 @@ require "luci.model.uci"
 local icount = 0
 local args = arg[1]
 local uci = luci.model.uci.cursor()
-local TMP_DNSMASQ_PATH = "${DNSMASQ_CONF_DIR%*/}/dnsmasq-ssrplus.d"
-luci.sys.call("mkdir -p " .. TMP_DNSMASQ_PATH)
+local TMP_DNSMASQ_PATH = luci.sys.exec("find /tmp/dnsmasq.*/dnsmasq-ssrplus.d -print 2>/dev/null | head -n 1"):gsub("%s+", "")
 local TMP_PATH = "/var/etc/ssrplus"
 -- match comments/title/whitelist/ip address/excluded_domain
 local comment_pattern = "^[!\\[@]+"