Jump to content

Renegade X Server Watchdog


Giygas

Recommended Posts

So, I made this in Notepad++. It's a script to keep your Renegade X server from crashing. If your server dies for some reason, it'll come back. Don't touch anything in the batch, unless the comment says you can, or you know what you're doing.

 

Version 1.1 -- Fixed some recursive variable error, added comments. watchdogv1.1.bat

Spoiler

@echo off
rem The only two lines you should be touching are line 7 and line 20. Don't touch anything else.
cls
echo Protecting Renegade X from crashes... 
echo If you want to close your Renegade X Server and this script, close the Renegade X window and the command prompt. You can also do CTRL+C.
title Renegade X Watchdog - Modified by Giygas
cd "D:\path\to\RenX\Binaries\Win32"
SETLOCAL EnableExtensions 
set EXE=UDK.exe
:END 
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto ProcessFound
goto ProcessNotFound
:ProcessFound
echo (%time%) Your Renegade X server is running
timeout /t 5 /nobreak > NUL 
goto END 
:ProcessNotFound 
echo (%time%) Your Renegade X server is not running. Restarting. 
timeout /t 5 /nobreak > NUL 
start UDK.exe server CNC-Field?AdminPassword=password123?maxplayers=40 -port=7777 -silent 
goto END 
:FIN

 

 

Version 1.0 -- Initial Release watchdog.bat

Spoiler

@echo off
cls
echo Protecting Renegade X from crashes...
echo If you want to close your Renegade X Server and this script, close the Renegade X window and the command prompt. You can also do CTRL+C.
title Renegade X Watchdog - Modified by Giygas
cd "D:\path\to\renx\Binaries\Win32"
:END
SETLOCAL EnableExtensions

set EXE=UDK.exe

FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto ProcessFound

goto ProcessNotFound

:ProcessFound

echo (%time%) Your Renegade X server is running
timeout /t 5 /nobreak > NUL
goto END
:ProcessNotFound
echo (%time%) Your Renegade X server is not running. Restarting.
timeout /t 5 /nobreak > NUL
start UDK.exe server CNC-Field?AdminPassword=password123?maxplayers=40 -port=7777 -silent
goto END
:FIN

 

 

Q&A Section:

Q: Is this for Linux?

A: No, but if you want a Linux one made in Shell, I could do that, and even integrate tmux.

Q: IT DOESN'T WORK! FIX IT! FIX IT! FIX IT!
A: That isn't even a question, and your statement isn't helpful. If you have problems, give me, and other people, steps to reproduce whatever error or bug you're encountering.

Q: Which version of Windows is this for?

A: Idunno. I only tested it on Windows Server 2016. Feel free to test it on older Windows, but don't expect it to work 100%.

Q: Can I ch-
A: DON'T. TOUCH. IT. Unless you KNOW what you're doing, don't touch the bloody file. If you break anything by changing values, don't come to me for support.

Q: How do I use this?
A: Well, take the contents of the code wrapped text, or just be lazy and download the attached .bat, and put it into a .bat file in your base Renegade X server folder. Something like this.
KTICfih.png

 

Edited by Giygas
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...