From a2b35eb3c6b14e055c94147c443a4f7e2e9abced Mon Sep 17 00:00:00 2001 From: Reditus Date: Thu, 14 May 2026 06:09:53 +0100 Subject: [PATCH] fix: run pkill directly via ssh instead of batch file --- start.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/start.ps1 b/start.ps1 index 67097a5..8e8f143 100644 --- a/start.ps1 +++ b/start.ps1 @@ -176,10 +176,7 @@ if ($pfCheck) { } $RemotePort = 15432 -$killOldPfs = 'ssh -i "' + $SSHKey + '" -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 ' + $SSHUser + '@' + $ServerHost + ' "sudo pkill -f ''kubectl port-forward'' 2>/dev/null; sleep 1"' -$killOldPfs | Out-File -FilePath "$env:TEMP\ssh_kill_pf.bat" -Encoding ascii -cmd /c "$env:TEMP\ssh_kill_pf.bat" -Start-Sleep -Seconds 2 +ssh -i $SSHKey -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 ${SSHUser}@${ServerHost} "sudo pkill -f port-forward 2>/dev/null; sleep 2" 2>$null $remoteCmd = 'nohup sudo kubectl port-forward -n ' + $Namespace + ' svc/' + $DBService + ' ' + $LocalPort + ':' + $RemotePort + ' > /tmp/pf.log 2>&1 &' $pfRemote = 'ssh -i "' + $SSHKey + '" -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 ' + $SSHUser + '@' + $ServerHost + ' "' + $remoteCmd + '"'