mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-06 03:14:22 +08:00
update 2026-10-29 11:59:06
This commit is contained in:
1 parent
bc85557d34
commit
e2f86e09f4
5033 files changed
-2043160
No files matched your search
@@ -1,34 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
export PATH=/usr/sbin:/usr/bin:/sbin:/bin:/root/bin
|
||||
. /usr/share/passwall2/utils.sh
|
||||
|
||||
listen_address=$1
|
||||
listen_port=$2
|
||||
server_address=$3
|
||||
server_port=$4
|
||||
|
||||
busybox pgrep -af "${CONFIG}/" | grep -E 'app\.sh.*(start|stop)|nftables\.sh|iptables\.sh|subscribe\.lua' >/dev/null && {
|
||||
# No detection during specific task execution
|
||||
exit 0
|
||||
}
|
||||
|
||||
probeUrl=$(get_cache_var "HAPROXY_PROBE_URL")
|
||||
probeUrl="${probeUrl:-https://www.google.com/generate_204}"
|
||||
|
||||
case "$server_address" in
|
||||
\[*\]) ;;
|
||||
*:*) server_address="[$server_address]" ;;
|
||||
esac
|
||||
|
||||
# Probe once per round; HAProxy rise/fall handles consecutive successes and failures.
|
||||
status=$(/usr/bin/curl -q -I -o /dev/null -sk --noproxy "" -x "socks5h://${server_address}:${server_port}" --connect-timeout 3 --max-time 6 -w "%{http_code}" "$probeUrl") || exit 1
|
||||
|
||||
case "$status" in
|
||||
200|204)
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in new issue
Block a user