Skip to content

Commit 492d6b0

Browse files
committed
Merge branch 'dev'
2 parents 770b474 + d1693b6 commit 492d6b0

40 files changed

+72182
-71925
lines changed

luci-app-openclash/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include $(TOPDIR)/rules.mk
22

33
PKG_NAME:=luci-app-openclash
4-
PKG_VERSION:=0.46.133
4+
PKG_VERSION:=0.46.137
55
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
66

77
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

luci-app-openclash/luasrc/controller/openclash.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3159,16 +3159,16 @@ function action_oc_action()
31593159
if action == "start" then
31603160
uci:set("openclash", "config", "enable", "1")
31613161
uci:commit("openclash")
3162-
luci.sys.call("/etc/init.d/openclash start >/dev/null 2>&1 &")
3162+
luci.sys.call("/etc/init.d/openclash start >/dev/null 2>&1")
31633163
elseif action == "stop" then
31643164
uci:set("openclash", "config", "enable", "0")
31653165
uci:commit("openclash")
31663166
luci.sys.call("ps | grep openclash | grep -v grep | awk '{print $1}' | xargs -r kill -9 >/dev/null 2>&1")
3167-
luci.sys.call("/etc/init.d/openclash stop >/dev/null 2>&1 &")
3167+
luci.sys.call("/etc/init.d/openclash stop >/dev/null 2>&1")
31683168
elseif action == "restart" then
31693169
uci:set("openclash", "config", "enable", "1")
31703170
uci:commit("openclash")
3171-
luci.sys.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
3171+
luci.sys.call("/etc/init.d/openclash restart >/dev/null 2>&1")
31723172
else
31733173
luci.http.status(400, "Invalid action parameter")
31743174
return

luci-app-openclash/luasrc/view/openclash/status.htm

Lines changed: 116 additions & 105 deletions
Large diffs are not rendered by default.

luci-app-openclash/po/zh-cn/openclash.zh-cn.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,6 +2100,9 @@ msgstr "第六步:删除 OpenClash 残留文件..."
21002100
msgid "OpenClash Already Stop!"
21012101
msgstr "OpenClash 关闭成功!"
21022102

2103+
msgid "Skip Reload OpenClash Firewall Rules Until 5 Minutes Later..."
2104+
msgstr "5 分钟内重置已超过 3 次,跳过本次 OpenClash 防火墙规则重置..."
2105+
21032106
msgid "Reload OpenClash Firewall Rules..."
21042107
msgstr "重置 OpenClash 防火墙规则..."
21052108

luci-app-openclash/root/etc/init.d/openclash

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3130,16 +3130,28 @@ start_watchdog()
31303130
reload_service()
31313131
{
31323132
enable=$(uci -q get openclash.config.enable)
3133+
MAX_RELOAD=10
31333134
if pidof clash >/dev/null && [ "$enable" == "1" ] && [ "$1" == "firewall" ]; then
3134-
LAST_RELOAD_TIME=$(grep "Reload OpenClash Firewall Rules..." "$LOG_FILE" | tail -n 1 | awk '{print $1" "$2}')
3135-
if [ -n "$LAST_RELOAD_TIME" ]; then
3136-
LAST_RELOAD_TS=$(date -d "$LAST_RELOAD_TIME" +%s 2>/dev/null)
3137-
NOW_TS=$(date +%s)
3138-
if [ -n "$LAST_RELOAD_TS" ] && [ $((NOW_TS - LAST_RELOAD_TS)) -lt 300 ]; then
3139-
exit 0
3140-
fi
3141-
fi
3142-
LOG_OUT "Reload OpenClash Firewall Rules..."
3135+
NOW_TS=$(date +%s)
3136+
LAST_LINE=$(grep "Reload OpenClash Firewall Rules...$" "$LOG_FILE" | tail -n 1)
3137+
LAST_TIME=$(echo "$LAST_LINE" | awk '{print $1" "$2}')
3138+
LAST_TS=$(date -d "$LAST_TIME" +%s 2>/dev/null)
3139+
CUR_RELOAD_NUM=$(echo "$LAST_LINE" | grep -oE '【[0-9]+/' | grep -oE '[0-9]+')
3140+
if [ -n "$LAST_TS" ] && [ $((NOW_TS - LAST_TS)) -gt 300 ]; then
3141+
CUR_RELOAD_NUM=0
3142+
fi
3143+
[ -z "$CUR_RELOAD_NUM" ] && CUR_RELOAD_NUM=0
3144+
CUR_RELOAD_NUM=$((CUR_RELOAD_NUM+1))
3145+
[ "$CUR_RELOAD_NUM" -gt "$MAX_RELOAD" ] && CUR_RELOAD_NUM=$MAX_RELOAD
3146+
RELOAD_COUNT=$(grep "Reload OpenClash Firewall Rules...$" "$LOG_FILE" | awk '{print $1" "$2}' | while read t; do
3147+
TS=$(date -d "$t" +%s 2>/dev/null)
3148+
[ -n "$TS" ] && [ $((NOW_TS - TS)) -le 300 ] && echo 1
3149+
done | wc -l)
3150+
if [ "$RELOAD_COUNT" -ge "$MAX_RELOAD" ]; then
3151+
LOG_OUT "${CUR_RELOAD_NUM}/$MAX_RELOAD】Skip Reload OpenClash Firewall Rules Until 5 Minutes Later..."
3152+
exit 0
3153+
fi
3154+
LOG_OUT "${CUR_RELOAD_NUM}/$MAX_RELOAD】Reload OpenClash Firewall Rules..."
31433155
revert_firewall
31443156
do_run_mode
31453157
get_config
-648 Bytes
Binary file not shown.

luci-app-openclash/root/etc/openclash/GeoSite.dat

Lines changed: 71703 additions & 71498 deletions
Large diffs are not rendered by default.

luci-app-openclash/root/etc/openclash/china_ip6_route.ipset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@
692692
2402:1600::/32
693693
2402:16e0::/32
694694
2402:1740::/32
695+
2402:18a0::/32
695696
2402:19c0::/32
696697
2402:1f80::/32
697698
2402:2000::/32
@@ -1573,7 +1574,6 @@
15731574
2405:ed40::/32
15741575
2405:ef40::/30
15751576
2405:f340::/32
1576-
2405:f3c0::/32
15771577
2405:f580::/32
15781578
2405:f6c0::/32
15791579
2405:f940::/32

luci-app-openclash/root/etc/openclash/china_ip_route.ipset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6345,6 +6345,7 @@
63456345
165.101.122.0/23
63466346
165.101.144.0/23
63476347
165.101.170.0/23
6348+
165.101.208.0/23
63486349
166.111.0.0/16
63496350
167.139.0.0/16
63506351
167.189.0.0/16

luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Config-B1EwbU18.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)