chore(M00-A): 建立单仓库基线和参考清单
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$hostName = "git.txyundm.cn"
|
||||
$port = "2222"
|
||||
$knownHosts = Join-Path $env:USERPROFILE ".ssh\known_hosts"
|
||||
|
||||
Write-Host "Checking known_hosts entries for $hostName port $port"
|
||||
& ssh-keygen -F "[$hostName]:$port"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "WARN: no known_hosts entry for [$hostName]:$port"
|
||||
}
|
||||
|
||||
Write-Host "Attempting read-only SSH handshake."
|
||||
& ssh -T -p $port "git@$hostName"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Gitea SSH handshake failed. Confirm host fingerprint before editing $knownHosts."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user