Scripts: Port konfigurierbar (SET/Argument), stop-webdav findstr-Fix

Made-with: Cursor
This commit is contained in:
2026-02-28 14:53:58 +01:00
parent eceb9c297a
commit 0a02f4f849
3 changed files with 17 additions and 5 deletions

View File

@@ -2,9 +2,12 @@
REM Duplicati Post-Backup: WebDAV-Server beenden
REM In Duplicati: Einstellungen -> Erweitert -> Scripts -> Nach dem Backup ausfuehren
REM Pfad: C:\Pfad\zu\internxt-webdav\scripts\stop-webdav.cmd
REM Optional: Port als Argument (z.B. stop-webdav.cmd 8080)
REM Prozess auf Port 3005 finden und beenden
for /f "tokens=5" %%a in ('netstat -ano 2^>nul ^| findstr ":3005.*LISTENING"') do (
if "%1"=="" (set PORT=3005) else (set PORT=%1)
REM Prozess auf Port finden und beenden
for /f "tokens=5" %%a in ('netstat -ano 2^>nul ^| findstr ":%PORT% " ^| findstr "LISTENING"') do (
taskkill /PID %%a /F > nul 2>&1
echo WebDAV-Server beendet (PID %%a).
exit /b 0