add support for multiple ip addresses in monitor-all.sh (#7244)

This commit is contained in:
moshekv
2025-08-28 08:17:58 +03:00
committed by GitHub
parent 3f3f536ebe
commit 644e5900d9

View File

@@ -93,7 +93,7 @@ while true; do
fi
else
# Container: get IP and ping
IP=$(pct exec $instance ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
IP=$(pct exec $instance ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1 | head -n1)
if ! ping -c 1 $IP >/dev/null 2>&1; then
echo "$(date): CT $instance is not responding, restarting..."
pct stop $instance >/dev/null 2>&1