Add background launcher scripts
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
@echo off
|
||||||
|
title Detener AidsMonitoring
|
||||||
|
echo Deteniendo AidsMonitoring (puerto 5503)...
|
||||||
|
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":5503 " ^| findstr "LISTENING"') do (
|
||||||
|
echo Terminando proceso PID %%a...
|
||||||
|
taskkill /F /PID %%a >nul 2>&1
|
||||||
|
)
|
||||||
|
echo Listo.
|
||||||
|
timeout /t 2 >nul
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
' AidsMonitoring — Inicia servidor uvicorn en segundo plano (sin ventana)
|
||||||
|
Option Explicit
|
||||||
|
Dim oShell, sBackend, sPython, sLog
|
||||||
|
|
||||||
|
sBackend = "C:\AidsMonitoring\backend"
|
||||||
|
sPython = "C:\Users\aerom\AppData\Local\Python\pythoncore-3.14-64\pythonw.exe"
|
||||||
|
sLog = "C:\AidsMonitoring\logs\server.log"
|
||||||
|
|
||||||
|
Set oShell = CreateObject("WScript.Shell")
|
||||||
|
|
||||||
|
Dim oExec, sOut
|
||||||
|
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5503 | findstr LISTENING")
|
||||||
|
sOut = oExec.StdOut.ReadAll()
|
||||||
|
If Len(Trim(sOut)) > 0 Then
|
||||||
|
MsgBox "AidsMonitoring ya esta corriendo en el puerto 5503.", 64, "AidsMonitoring"
|
||||||
|
WScript.Quit
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Uvicorn via pythonw — redirige stdout/stderr al log
|
||||||
|
oShell.Run "cmd /c cd /d """ & sBackend & """ && """ & sPython & """ -m uvicorn main:app --host 0.0.0.0 --port 5503 >> """ & sLog & """ 2>&1", 0, False
|
||||||
|
|
||||||
|
WScript.Sleep 2500
|
||||||
|
|
||||||
|
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5503 | findstr LISTENING")
|
||||||
|
sOut = oExec.StdOut.ReadAll()
|
||||||
|
If Len(Trim(sOut)) > 0 Then
|
||||||
|
MsgBox "AidsMonitoring iniciado correctamente." & vbCrLf & vbCrLf & _
|
||||||
|
"URL: http://localhost:5503" & vbCrLf & _
|
||||||
|
"Tailscale: http://100.96.43.86:5503", 64, "AidsMonitoring"
|
||||||
|
Else
|
||||||
|
MsgBox "El servidor tardo en iniciar. Revisa logs\server.log si hay errores.", 48, "AidsMonitoring"
|
||||||
|
End If
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
@echo off
|
||||||
|
if exist "logs\server.log" (notepad "logs\server.log") else (echo No hay log todavia. & pause)
|
||||||
Reference in New Issue
Block a user