Add start-service.bat script for Resource Monitor Service v2.0
- Introduced a batch script to simplify the startup process for the Resource Monitor Service. - Included checks for .NET 9.0 Runtime installation. - Added build and run commands for the service with appropriate error handling. - Provided user instructions and API documentation links in the script output.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
@echo off
|
||||
REM Resource Monitor Service - Quick Start Script
|
||||
|
||||
echo Starting Resource Monitor Service v2.0...
|
||||
echo.
|
||||
echo This service will monitor your VM's resources and provide a REST API
|
||||
echo for remote monitoring from your Unraid server.
|
||||
echo.
|
||||
echo Service will be available at: http://localhost:5000
|
||||
echo API Documentation: http://localhost:5000/api/health
|
||||
echo.
|
||||
echo Press Ctrl+C to stop the service
|
||||
echo.
|
||||
|
||||
REM Change to the script's directory
|
||||
cd /d "%~dp0"
|
||||
|
||||
REM Check if .NET 9 is installed
|
||||
dotnet --version > nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo ERROR: .NET 9.0 Runtime is required but not found.
|
||||
echo Please install .NET 9.0 Runtime from: https://dotnet.microsoft.com/download
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Build and run the service
|
||||
echo Building service...
|
||||
dotnet build --configuration Release
|
||||
if errorlevel 1 (
|
||||
echo ERROR: Build failed. Please check the error messages above.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo Starting service on http://localhost:5000
|
||||
echo.
|
||||
dotnet run --configuration Release
|
||||
|
||||
pause
|
||||
Reference in New Issue
Block a user