Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
aa65535 committed Sep 13, 2022
1 parent f0e7a9e commit e2b92cb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Jian Chang <[email protected]>

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_BUILD_DEPENDS:=po2lmo/host

include $(INCLUDE_DIR)/package.mk

Expand All @@ -25,11 +26,17 @@ define Package/luci-app-shadowsocks/Default
SUBMENU:=3. Applications
TITLE:=LuCI Support for shadowsocks-libev
PKGARCH:=all
DEPENDS:=+iptables +wget +resolveip $(1)
endef

Package/luci-app-shadowsocks = $(call Package/luci-app-shadowsocks/Default,+ipset)
Package/luci-app-shadowsocks-without-ipset = $(call Package/luci-app-shadowsocks/Default)
define Package/luci-app-shadowsocks
$(call Package/luci-app-shadowsocks/Default)
EXTRA_DEPENDS:=iptables, wget, resolveip, ipset
endef

define Package/luci-app-shadowsocks-without-ipset
$(call Package/luci-app-shadowsocks/Default)
EXTRA_DEPENDS:=iptables, wget, resolveip
endef

define Package/luci-app-shadowsocks/description
LuCI Support for shadowsocks-libev.
Expand Down
12 changes: 11 additions & 1 deletion files/root/etc/init.d/shadowsocks
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ START=90
STOP=15
USE_PROCD=1
NAME=shadowsocks
EXTRA_COMMANDS="rules"
if type extra_command >/dev/null 2>&1; then
extra_command "rules" "Reload transparent proxy rules"
else
EXTRA_COMMANDS="rules"
fi

uci_get_by_name() {
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
Expand Down Expand Up @@ -238,3 +242,9 @@ boot() {
(sleep $delay && start >/dev/null 2>&1) &
return 0
}

reload_service() {
stop
sleep 1
start
}
4 changes: 1 addition & 3 deletions files/root/etc/uci-defaults/luci-shadowsocks
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ uci get shadowsocks.@access_control[-1] >/dev/null 2>&1 || \
uci add shadowsocks access_control >/dev/null 2>&1
uci commit shadowsocks
uci -q batch <<-EOF >/dev/null
delete ucitrack.@shadowsocks[-1]
commit ucitrack
delete firewall.shadowsocks
set firewall.shadowsocks=include
set firewall.shadowsocks.type=script
set firewall.shadowsocks.path=/var/etc/shadowsocks.include
set firewall.shadowsocks.family=ipv4
set firewall.shadowsocks.reload=1
set firewall.shadowsocks.reload=0
commit firewall
EOF
if [ -f /etc/crontabs/root ]; then
Expand Down
2 changes: 1 addition & 1 deletion files/root/usr/share/rpcd/acl.d/luci-app-shadowsocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"uci": [ "shadowsocks" ]
}
}
}
}

0 comments on commit e2b92cb

Please sign in to comment.