|
@@ -1,8 +1,11 @@
|
|
|
param([Parameter(ValueFromRemainingArguments=$true)][string[]]$Command)
|
|
param([Parameter(ValueFromRemainingArguments=$true)][string[]]$Command)
|
|
|
$ErrorActionPreference='Stop'
|
|
$ErrorActionPreference='Stop'
|
|
|
$delays=2,5,10,20,30
|
|
$delays=2,5,10,20,30
|
|
|
|
|
+$knownHosts=Join-Path $HOME '.ssh\known_hosts'
|
|
|
for($i=0;$i -lt $delays.Count;$i++){
|
|
for($i=0;$i -lt $delays.Count;$i++){
|
|
|
- & ssh -o ConnectTimeout=10 -o ServerAliveInterval=15 -o ServerAliveCountMax=4 edk2-uefi-lab @Command
|
|
|
|
|
|
|
+ & ssh -o StrictHostKeyChecking=yes -o "UserKnownHostsFile=$knownHosts" `
|
|
|
|
|
+ -o ConnectTimeout=10 -o ServerAliveInterval=15 -o ServerAliveCountMax=4 `
|
|
|
|
|
+ edk2-uefi-lab @Command
|
|
|
if($LASTEXITCODE -eq 0){exit 0}
|
|
if($LASTEXITCODE -eq 0){exit 0}
|
|
|
if($i -eq 4){throw 'REMOTE_NETWORK_UNSTABLE'}
|
|
if($i -eq 4){throw 'REMOTE_NETWORK_UNSTABLE'}
|
|
|
Start-Sleep -Seconds $delays[$i]
|
|
Start-Sleep -Seconds $delays[$i]
|