Add background launcher scripts

This commit is contained in:
2026-05-05 02:34:49 -04:00
commit fe61f1f48e
4 changed files with 42 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
@echo off
title Detener Fleet Management
echo Deteniendo Fleet Management (puerto 5010)...
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":5010 " ^| findstr "LISTENING"') do (
echo Terminando proceso PID %%a...
taskkill /F /PID %%a >nul 2>&1
)
echo Listo.
timeout /t 2 >nul
+31
View File
@@ -0,0 +1,31 @@
' Fleet Management — Inicia servidor en segundo plano (sin ventana)
Option Explicit
Dim oShell, sDir, sPython, sLog
sDir = "C:\fleet-management"
sPython = "C:\fleet-management\venv\Scripts\pythonw.exe"
sLog = sDir & "\logs\server.log"
Set oShell = CreateObject("WScript.Shell")
Dim oExec, sOut
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5010 | findstr LISTENING")
sOut = oExec.StdOut.ReadAll()
If Len(Trim(sOut)) > 0 Then
MsgBox "Fleet Management ya esta corriendo en el puerto 5010.", 64, "Fleet Management"
WScript.Quit
End If
oShell.Run "cmd /c cd /d """ & sDir & """ && """ & sPython & """ run.py >> """ & sLog & """ 2>&1", 0, False
WScript.Sleep 1500
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5010 | findstr LISTENING")
sOut = oExec.StdOut.ReadAll()
If Len(Trim(sOut)) > 0 Then
MsgBox "Fleet Management iniciado correctamente." & vbCrLf & vbCrLf & _
"URL: http://localhost:5010" & vbCrLf & _
"Tailscale: http://100.96.43.86:5010", 64, "Fleet Management"
Else
MsgBox "El servidor tardo en iniciar. Revisa logs\server.log si hay errores.", 48, "Fleet Management"
End If
+2
View File
@@ -0,0 +1,2 @@
@echo off
if exist "logs\server.log" (notepad "logs\server.log") else (echo No hay log todavia. & pause)
View File