#
PKG_NAME:=shadowsocks-libev
PKG_VERSION:=3.3.5
-PKG_RELEASE:=6
+PKG_RELEASE:=7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
fi
}
-ss_rules() {
+ss_rules_nft_gen() {
local cfg="ss_rules"
local cfgtype
local local_port_tcp local_port_udp
eval "$(validate_ss_rules_section "$cfg" ss_validate_mklocal)"
validate_ss_rules_section "$cfg" || return 1
- [ "$disabled" = 0 ] || return 0
+ [ "$disabled" = 0 ] || return 2
eval local_port_tcp="\$ss_rules_redir_tcp_$redir_tcp"
eval local_port_udp="\$ss_rules_redir_udp_$redir_udp"
echo "table inet chk {include \"$tmp.nft\";}" >"$tmp.nft.chk"
if nft -f "$tmp.nft.chk" -c; then
mv "$tmp.nft" "$ssrules_nft"
- fw4 reload
+ fw4 restart
fi
rm -f "$tmp.nft.chk"
fi
rm -f "$tmp.nft"
}
+ss_rules_nft_reset() {
+ if [ -f "$ssrules_nft" ]; then
+ rm -f "$ssrules_nft"
+ fw4 restart
+ fi
+}
+
+ss_rules() {
+ if ! ss_rules_nft_gen; then
+ ss_rules_nft_reset
+ fi
+}
+
start_service() {
local cfgtype
}
stop_service() {
- if [ -f "$ssrules_nft" ]; then
- rm -f "$ssrules_nft"
- fw4 reload
- fi
+ ss_rules_nft_reset
rm -rf "$ss_confdir"
}