- the Install section now leads with the release artifacts (the wheel via pipx/pip, the direct release URL, `gh release download` for the version-agnostic case, and the source archive) and keeps the git clone as the development path. It finally names the launchers (./start.sh, start.bat): a clone needs no install, but the README never said how to start it while the Running section only showed the console script that an install provides. - Windows: the USB section now says the .bat launchers mirror the shell ones and call the `python` command (Python 3 must be on PATH); the Install section carries the same note. - start.bat: --db/DB was parsed and then never passed to the server; it is passed now, and --gsmtap-port is sent only for gsmtap capture (as start.sh already did). Both .bat files passed values unquoted and stripped the quotes of pass-through options, so paths with spaces broke (--db "C:\My Data\...", --web-dir, --pcap, --output); values are quoted now and pass-through keeps the original quoting (argument assembly through delayed expansion). - the launcher usage comments include the `disabled` capture mode. - verified the argument assembly with Wine cmd.exe and an echo harness: the quoted paths survive, --db arrives, --gsmtap-port appears only for gsmtap; 547 Python + 80 Node tests.
60 lines
1.3 KiB
Batchfile
60 lines
1.3 KiB
Batchfile
@echo off
|
|
setlocal enabledelayedexpansion
|
|
|
|
:: simtrace-analyser-server startup script for Windows
|
|
::
|
|
:: Usage: start.bat [--capture gsmtap|direct|disabled] [--port PORT] [--db PATH] [--gsmtap-port PORT]
|
|
::
|
|
:: Options set via environment variables act as defaults; CLI flags override them.
|
|
|
|
set "CAPTURE=%CAPTURE%"
|
|
if "%CAPTURE%"=="" set "CAPTURE=gsmtap"
|
|
set "PORT=%PORT%"
|
|
if "%PORT%"=="" set "PORT=8081"
|
|
set "DB=%DB%"
|
|
set "GSMTAP_PORT=%GSMTAP_PORT%"
|
|
if "%GSMTAP_PORT%"=="" set "GSMTAP_PORT=4729"
|
|
set "EXTRA_ARGS="
|
|
|
|
:parse_args
|
|
if "%~1"=="" goto :run
|
|
if "%~1"=="--capture" (
|
|
set "CAPTURE=%~2"
|
|
shift
|
|
shift
|
|
goto :parse_args
|
|
)
|
|
if "%~1"=="--port" (
|
|
set "PORT=%~2"
|
|
shift
|
|
shift
|
|
goto :parse_args
|
|
)
|
|
if "%~1"=="--db" (
|
|
set "DB=%~2"
|
|
shift
|
|
shift
|
|
goto :parse_args
|
|
)
|
|
if "%~1"=="--gsmtap-port" (
|
|
set "GSMTAP_PORT=%~2"
|
|
shift
|
|
shift
|
|
goto :parse_args
|
|
)
|
|
set "EXTRA_ARGS=!EXTRA_ARGS! %1"
|
|
shift
|
|
goto :parse_args
|
|
|
|
:run
|
|
echo Starting simtrace-analyser-server...
|
|
echo PWA (simtrace-analyser) will be served at http://127.0.0.1:%PORT%/
|
|
|
|
set "ARGS=--capture "%CAPTURE%" --port "%PORT%""
|
|
if not "%DB%"=="" set "ARGS=!ARGS! --db "%DB%""
|
|
if /i "%CAPTURE%"=="gsmtap" set "ARGS=!ARGS! --gsmtap-port "%GSMTAP_PORT%""
|
|
set "ARGS=!ARGS! !EXTRA_ARGS!"
|
|
|
|
set "PYTHONPATH=%~dp0"
|
|
python -m simtrace_analyser !ARGS!
|