commit 47f761a3e756d09d43de210944726837a49a00b2 Author: Leo <1+diablo@noreply.localhost> Date: Sat Oct 10 01:13:30 2026 +0800 Add check-host.sh diff --git a/check-host.sh b/check-host.sh new file mode 100644 index 0000000..8e2a74e --- /dev/null +++ b/check-host.sh @@ -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 \ No newline at end of file