From f16852f4764f7bc7f9f987b44284af86f39d5bdf Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Tue, 3 Mar 2020 18:01:05 -0800 Subject: [PATCH 1/2] luci-app-ssr-plus: add support dnsmasq format ad-filter --- package/lean/luci-app-ssr-plus/Makefile | 2 +- .../luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua | 1 + package/lean/luci-app-ssr-plus/root/usr/bin/ssr-ad | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index 3c26b58db6..319e00a209 100644 --- a/package/lean/luci-app-ssr-plus/Makefile +++ b/package/lean/luci-app-ssr-plus/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ssr-plus -PKG_VERSION:=158 +PKG_VERSION:=159 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/package/lean/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua b/package/lean/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua index d882b2ed2e..6242512c88 100644 --- a/package/lean/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua +++ b/package/lean/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua @@ -136,6 +136,7 @@ if sret== 0 then luci.sys.exec("cp -f /tmp/ad.conf /etc/dnsmasq.ssr/ad.conf") retstring=tostring(math.ceil(tonumber(icount))) if oldcount==0 then + luci.sys.exec("cp -f /etc/dnsmasq.ssr/ad.conf /tmp/dnsmasq.ssr/ad.conf") luci.sys.call("/etc/init.d/dnsmasq restart") end else diff --git a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-ad b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-ad index 0846065c05..2c7ffef057 100755 --- a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-ad +++ b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-ad @@ -1,5 +1,9 @@ #!/bin/sh -e if [ -f /tmp/adnew.conf ]; then - cat /tmp/adnew.conf | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/ad.conf + if (grep -wq "address=" /tmp/adnew.conf) ; then + cp /tmp/adnew.conf /tmp/ad.conf + else + cat /tmp/adnew.conf | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/ad.conf + fi fi rm -f /tmp/adnew.conf From d79a2f4070b732539375969812e32e2187bc5818 Mon Sep 17 00:00:00 2001 From: Xiaok Date: Wed, 4 Mar 2020 10:02:10 +0800 Subject: [PATCH 2/2] npc: Improved compile duplicate download issues (#3521) --- package/lean/npc/Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/package/lean/npc/Makefile b/package/lean/npc/Makefile index 9a6638787f..ee918238ed 100644 --- a/package/lean/npc/Makefile +++ b/package/lean/npc/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=npc PKG_VERSION:=0.26.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 ifeq ($(ARCH),mipsel) NPC_ARCH:=mipsle @@ -37,6 +37,8 @@ endif PKG_LICENSE:=Apache-2.0 PKG_BUILD_DIR:=$(BUILD_DIR)/npc-$(PKG_VERSION) +PKG_URL:=https://github.com/ehang-io/nps/releases/download/v$(PKG_VERSION)/linux_$(NPC_ARCH)_client.tar.gz +PKG_FILE:=nps_linux_$(NPC_ARCH)_client-$(PKG_VERSION).tar.gz include $(INCLUDE_DIR)/package.mk @@ -45,18 +47,22 @@ define Package/$(PKG_NAME) CATEGORY:=Network TITLE:=NPC Client DEPENDS:= - URL:=https://github.com/cnlh/nps/releases + URL:=https://github.com/ehang-io/nps/releases endef - - define Package/$(PKG_NAME)/description npc is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet endef +define Build/Download + if [ ! -f $(DL_DIR)/$(PKG_FILE) ] ; then \ + wget -c -t 5 -O $(DL_DIR)/$(PKG_FILE) $(PKG_URL); \ + fi +endef + define Build/Prepare - [ ! -f $(PKG_BUILD_DIR)/linux_$(NPC_ARCH)_client.tar.gz ] && wget https://github.com/cnlh/nps/releases/download/v$(PKG_VERSION)/linux_$(NPC_ARCH)_client.tar.gz -O $(PKG_BUILD_DIR)/linux_$(NPC_ARCH)_client.tar.gz - tar -zxvf $(PKG_BUILD_DIR)/linux_$(NPC_ARCH)_client.tar.gz -C $(PKG_BUILD_DIR) + $(Build/Download) + tar -zxvf $(DL_DIR)/$(PKG_FILE) -C $(PKG_BUILD_DIR) endef define Build/Configure