Includes homelab deploy tooling, image position/zoom manifest persistence, and full trading/casino stack. Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
891 B
PowerShell
34 lines
891 B
PowerShell
#Requires -Version 5.1
|
|
<#
|
|
.SYNOPSIS
|
|
Fuehrt einen Befehl auf dem Homelab aus (ohne interaktives SSH-Passwort).
|
|
|
|
.USAGE
|
|
.\deploy\homelab-exec.ps1 "systemctl status playbull --no-pager"
|
|
.\deploy\homelab-exec.ps1 -Sudo "bash deploy/install-homelab.sh"
|
|
#>
|
|
param(
|
|
[Parameter(Position = 0, Mandatory = $true)]
|
|
[string]$Command,
|
|
|
|
[switch]$Sudo,
|
|
[string]$WorkDir = "",
|
|
[int]$TimeoutSeconds = 120
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
. "$PSScriptRoot/homelab-lib.ps1"
|
|
|
|
$config = Get-HomelabConfig
|
|
$result = Invoke-HomelabRemote -Config $config -Command $Command -Sudo:$Sudo -WorkDir $WorkDir -TimeoutSeconds $TimeoutSeconds
|
|
|
|
if ($result.Output) {
|
|
$result.Output | ForEach-Object { Write-Output $_ }
|
|
}
|
|
if ($result.Error) {
|
|
$result.Error | ForEach-Object { [Console]::Error.WriteLine($_) }
|
|
}
|
|
if ($result.ExitStatus -ne 0) {
|
|
exit $result.ExitStatus
|
|
}
|