-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBE_LaunchServer.cmd
32 lines (23 loc) · 977 Bytes
/
BE_LaunchServer.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@echo off
echo initiating startup sequence. don't kill this. it'll die with the server.
start "Bedrock Dedicated Server" "%~dp0\bedrock_server.exe"
for /F "TOKENS=1,2,*" %%a in ('tasklist /FI "IMAGENAME eq bedrock_server.exe"') do set ServerPID=%%b
echo server PID: %ServerPID%
::Change up the string in here to modify the Message sent
Powershell.exe -executionpolicy remotesigned -File LogToWebHook.ps1 -content "Starting (Server)"
echo Server Started
::Estimated server startup time
timeout /t 20 >nul
::look above
Powershell.exe -executionpolicy remotesigned -File LogToWebHook.ps1 -content "Server should be running. Try connecting."
echo Server is running. Hide this Window
::Wait until Process PID not found
:loop
tasklist | find " %ServerPID% " >nul
if not errorlevel 1 (
timeout /t 10 >nul
goto :loop
)
echo Server process died.
::You know what by now
Powershell.exe -executionpolicy remotesigned -File LogToWebHook.ps1 -content "Server process died."