Add check-host.sh
This commit is contained in:
commit
47f761a3e7
1 file changed
+15
@@ -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
|
||||
Reference in new issue
Block a user