This commit is contained in:
2026-03-05 22:30:57 +01:00
parent 9e68ac42f2
commit d76abde68d

View File

@@ -39,7 +39,12 @@ if [[ -z "${HOST}" || -z "${USER}" ]]; then
exit 1
fi
SSH_OPTS=(-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null)
SSH_OPTS=()
if [[ "${PI_CONTROL_STRICT_HOSTKEY:-}" == "1" ]]; then
SSH_OPTS=(-o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/root/.ssh/known_hosts)
else
SSH_OPTS=(-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null)
fi
if [[ "${AUTH_TYPE}" == "key" && -n "${KEY_PATH}" ]]; then
exec ssh "${SSH_OPTS[@]}" -i "${KEY_PATH}" -p "${PORT:-22}" "${USER}@${HOST}"