16 lines
360 B
Bash
16 lines
360 B
Bash
#!/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 \
|
|
-i ~/.ssh/alpine_hosts \
|
|
-o BatchMode=yes \
|
|
-o StrictHostKeyChecking=accept-new \
|
|
"$SSH_USER@$host" \
|
|
'hostname'
|
|
done |