This commit is contained in:
eric
2026-05-19 06:47:07 +00:00
parent e1d7251545
commit 78e1308063
63 changed files with 2527 additions and 186 deletions

8
d2ypp2/scripts/linux/neko_ip_watch.sh Normal file → Executable file
View File

@@ -31,10 +31,8 @@ normalize_interval() {
running_neko_nat1to1_values() {
local name value
for name in live-neko-1 live-neko-2 live-neko-3; do
if ! docker ps --format '{{.Names}}' 2>/dev/null | grep -qx "$name"; then
continue
fi
docker ps --format '{{.Names}}' 2>/dev/null | grep -E '^live-neko-[0-9]+$' | sort -V | while read -r name; do
[ -n "$name" ] || continue
value="$(
docker inspect "$name" --format '{{range .Config.Env}}{{println .}}{{end}}' 2>/dev/null |
awk -F= '/^NEKO_WEBRTC_NAT1TO1=/{print $2; exit}'
@@ -51,7 +49,7 @@ maybe_refresh_neko_for_ip_change() {
if [ "${ENABLE_NEKO:-1}" != "1" ] || ! have docker; then
return 0
fi
if ! docker ps --format '{{.Names}}' 2>/dev/null | grep -Eq '^live-neko-[123]$'; then
if ! docker ps --format '{{.Names}}' 2>/dev/null | grep -Eq '^live-neko-[0-9]+$'; then
return 0
fi