diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index 75a0d5085..b38b7f22b 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=26.4.15 -PKG_RELEASE:=82 +PKG_RELEASE:=83 PKG_PO_VERSION:=$(PKG_VERSION) PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/root/usr/share/passwall/haproxy.lua b/luci-app-passwall/root/usr/share/passwall/haproxy.lua index 046328ceb..ba5e171fb 100644 --- a/luci-app-passwall/root/usr/share/passwall/haproxy.lua +++ b/luci-app-passwall/root/usr/share/passwall/haproxy.lua @@ -1,7 +1,7 @@ #!/usr/bin/lua local api = require ("luci.passwall.api") -local appname = "passwall" +local appname = api.appname local fs = api.fs local jsonc = api.jsonc local uci = api.uci @@ -175,8 +175,8 @@ listen %s if health_check_type == "passwall_logic" then f_out:write(string.format([[ option external-check - external-check command "/usr/share/passwall/haproxy_check.sh" -]], port, port)) + external-check command "/usr/share/%s/haproxy_check.sh" +]], appname)) end local count_M, count_B = 1, 1 @@ -206,7 +206,7 @@ listen %s f_out:write(" " .. api.trim(server_conf) .. "\n") if o.export ~= "0" then - sys.call(string.format(". /usr/share/passwall/utils.sh ; add_ip2route %s %s", o.origin_address, o.export)) + sys.call(string.format(". /usr/share/%s/utils.sh ; add_ip2route %s %s", appname, o.origin_address, o.export)) end log(string.format(" | - 出口节点:%s:%s,权重:%s", o.origin_address, o.origin_port, o.lbweight)) diff --git a/luci-app-passwall/root/usr/share/passwall/haproxy_check.sh b/luci-app-passwall/root/usr/share/passwall/haproxy_check.sh index 91c1531b1..cea5d6294 100755 --- a/luci-app-passwall/root/usr/share/passwall/haproxy_check.sh +++ b/luci-app-passwall/root/usr/share/passwall/haproxy_check.sh @@ -25,7 +25,7 @@ if /usr/bin/curl --help all | grep -q "\-\-retry-all-errors"; then extra_params="${extra_params} --retry-all-errors" fi -status=$(/usr/bin/curl -I -o /dev/null -skL ${extra_params} --connect-timeout 3 --retry 2 --max-time 10 -w "%{http_code}" "${probeUrl}") +status=$(/usr/bin/curl -I -o /dev/null -skL ${extra_params} --connect-timeout 3 --retry 1 --max-time 6 -w "%{http_code}" "${probeUrl}") case "$status" in 200|204)