From 47f761a3e756d09d43de210944726837a49a00b2 Mon Sep 17 00:00:00 2001 From: Leo <1+diablo@noreply.localhost> Date: Sat, 10 Oct 2026 01:13:30 +0800 Subject: [PATCH] Add check-host.sh --- check-host.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 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