ss
This commit is contained in:
8
d2ypp2/scripts/linux/neko_ip_watch.sh
Normal file → Executable file
8
d2ypp2/scripts/linux/neko_ip_watch.sh
Normal file → Executable 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user