Files
dsh/start-server.bat

27 lines
1.4 KiB
Batchfile

@echo off
rem Start the dsh-sync resident worker: hidden window, auto-restart loop.
rem NOTE: keep this file ASCII-only. UTF-8 Chinese text breaks batch parsing
rem under the GBK console codepage (leading chars of following lines get eaten).
rem
rem Refuses to start a second worker: two workers race for :8020 and the
rem loser spins on failed binds. server-worker.cmd also guards itself, but
rem catching it here keeps the log clean.
rem Match the LAN address, not ":8020" alone - the local Django dev stack
rem holds 127.0.0.1:8020 and would otherwise look like a running dsh.
set DSH_HOST=192.168.5.2
set DSH_PORT=8020
netstat -ano | findstr /C:"LISTENING" | findstr /C:"%DSH_HOST%:%DSH_PORT% " >nul
if not errorlevel 1 (
echo dsh-sync is already listening on %DSH_HOST%:%DSH_PORT% - run stop-server.bat first.
exit /b 1
)
powershell -NoProfile -Command "Start-Process -WindowStyle Hidden -FilePath 'C:\Users\12914\Desktop\dsh\server-worker.cmd' -WorkingDirectory 'C:\Users\12914\Desktop\dsh'"
echo dsh-sync started detached (hidden worker, auto-restart loop).
echo Mobile PWA: http://192.168.5.2:8020/app invite code: d4977f261a7e
echo admin opens PWA - Settings - "Connect Phone" shows the QR code
echo Admin: http://192.168.5.2:8020 token: 74020d5458c05a43e6abca0ddea020b5
echo Logs: logs\uvicorn.log / logs\server.log Stop: stop-server.bat