Last active
February 11, 2026 10:14
-
-
Save liebki/a83e3cb6e27fb99aa8f98f9e94f6f613 to your computer and use it in GitHub Desktop.
Minecraft Java Server - Restart Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| JAVA_CMD="java" | |
| JAVA_ARGS="-Xms1G -Xmx1G -jar" | |
| SERVER_NAME="server.jar" | |
| while true | |
| do | |
| $JAVA_CMD $JAVA_ARGS $SERVER_NAME | |
| sleep 5 | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| A simple bash and cmd file which can be used to run a minecraft java server and automatically restart it after the process stopped. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| set JAVA_CMD=java | |
| set JAVA_ARGS=-Xms1G -Xmx1G -jar | |
| set SERVER_NAME=server.jar | |
| :loop | |
| %JAVA_CMD% %JAVA_ARGS% %SERVER_NAME% | |
| timeout /t 5 /nobreak >nul | |
| goto loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment