Skip to content

Commit

Permalink
0.46.062
Browse files Browse the repository at this point in the history
  • Loading branch information
vernesong committed Dec 26, 2024
1 parent 1d2cac5 commit 5a73c08
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion luci-app-openclash/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.46.061
PKG_VERSION:=0.46.062
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
Expand Down
5 changes: 4 additions & 1 deletion luci-app-openclash/po/zh-cn/openclash.zh-cn.po
Original file line number Diff line number Diff line change
Expand Up @@ -3448,4 +3448,7 @@ msgid "Internal ports"
msgstr "内部端口"

msgid "Target"
msgstr "对象"
msgstr "对象"

msgid "Error: Network Anomaly, Suspend Unlock Detection..."
msgstr "错误:网络异常,暂停解锁检测..."
Original file line number Diff line number Diff line change
Expand Up @@ -1579,4 +1579,18 @@ function openai_unlock_test()
end
end

unlock_auto_select()
function network_test()
local test_url1 = "https://www.gstatic.com/generate_204"
local test_url2 = "https://cp.cloudflare.com/generate_204"
local httpcode1 = SYS.exec(string.format("curl -sL --connect-timeout 5 -m 5 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' '%s'", UA, test_url1))
local httpcode2 = SYS.exec(string.format("curl -sL --connect-timeout 5 -m 5 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' '%s'", UA, test_url2))
if httpcode1 or httpcode2 then
if tonumber(httpcode1) == 200 or tonumber(httpcode2) == 200 then
unlock_auto_select()
return
end
end
print("Error: Network Anomaly, Suspend Unlock Detection...")
end

network_test()

0 comments on commit 5a73c08

Please sign in to comment.