Add check-host.sh

This commit is contained in:
diablo committed 2026-10-10 01:13:30 +08:00
commit 47f761a3e7
1 file changed
+15
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail
: "${TARGET_HOSTS:?TARGET_HOSTS is not configured}"
: "${SSH_USER:?SSH_USER is not configured}"
for host in $TARGET_HOSTS; do
echo "Connecting to $host..."
ssh \
-o BatchMode=yes \
-o StrictHostKeyChecking=accept-new \
"$SSH_USER@$host" \
'hostname'
done