PS scripts: my_cars.json sync falls back to hunnius.net when moria is unreachable (travel mode; hunnius receives the file hourly from the moria sync cron)
All checks were successful
build / build-test (push) Successful in 1m17s

This commit is contained in:
Jan-Peter von Hunnius 2026-08-31 07:28:57 +02:00
parent ead4c721d4
commit 39cbc8b2de
2 changed files with 16 additions and 4 deletions

View file

@ -3,8 +3,14 @@ $ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
if (-not $NoSync) {
Write-Host "Syncing my_cars.json from moria ..."
scp -q jan@192.168.1.2:Development/top_drives/my_cars.json .\my_cars.json
ssh -o ConnectTimeout=3 -o BatchMode=yes jan@192.168.1.2 "exit" 2>$null
if ($LASTEXITCODE -eq 0) {
Write-Host "Syncing my_cars.json from moria (LAN) ..."
scp -q jan@192.168.1.2:Development/top_drives/my_cars.json .\my_cars.json
} else {
Write-Host "moria unreachable - syncing my_cars.json from hunnius.net (remote) ..."
scp -q jan@hunnius.net:Development/top_drives/my_cars.json .\my_cars.json
}
if ($LASTEXITCODE -ne 0) { throw "my_cars.json sync failed" }
}

View file

@ -3,8 +3,14 @@ $ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
if (-not $NoSync) {
Write-Host "Syncing my_cars.json from moria ..."
scp -q jan@192.168.1.2:Development/top_drives/my_cars.json .\my_cars.json
ssh -o ConnectTimeout=3 -o BatchMode=yes jan@192.168.1.2 "exit" 2>$null
if ($LASTEXITCODE -eq 0) {
Write-Host "Syncing my_cars.json from moria (LAN) ..."
scp -q jan@192.168.1.2:Development/top_drives/my_cars.json .\my_cars.json
} else {
Write-Host "moria unreachable - syncing my_cars.json from hunnius.net (remote) ..."
scp -q jan@hunnius.net:Development/top_drives/my_cars.json .\my_cars.json
}
if ($LASTEXITCODE -ne 0) { throw "my_cars.json sync failed" }
}