Skip to content

Instantly share code, notes, and snippets.

@huserg
Created October 14, 2019 18:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save huserg/36a44aee3ac25e426234f18b5c74af2e to your computer and use it in GitHub Desktop.
Save huserg/36a44aee3ac25e426234f18b5c74af2e to your computer and use it in GitHub Desktop.
Minecraft server launch python script
#!/usr/bin/env python
import os
import sys
u_id = 1000
ram = "8"
minimum_ram = "8"
screen_name = "FaFIndustriesMinecraftServer"
java_app_name = "spigot-1.13.2"
command = 'screen -dmS ' + screen_name + ' java -Xmx' + ram + 'G -Xms' + minimum_ram + 'G -XX:+UseConcMarkSweepGC -jar ' + java_app_name + '.jar'
try:
'java --version'
except OSError :
sys.exit('JAVA is not installed ! Please install it first and then rerun this program')
print 'Starting the ' + java_app_name + ' with ' + ram + ' Go RAM'
os.system(command)
print 'Server started in screen named ' + screen_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment