I'm trying to use a script to start my Minecraft server on a detached screen. I have a start.sh
file setup as per instructions:
#!/bin/sh
screen -d -m -S minecraft java -Xms6G -Xmx6G -jar spigot-1.15.2.jar
After I execute start.sh
, I check my screen list my Minecraft screen does not exist. If I cut out the screen bit the script works exactly as intended (screen also works just fine on its own). I'm not too experienced with bash, I may need an ELI5.
edit: some clarification
screen
installed?java -Xms6G -Xmx6G -jar spigot-1.15.2.jar
bit. If I include the screen part, it just does nothing. No error, no warning, no screen created.start.sh
withsudo
because the jar won't run otherwise. If I just run the script withoutsudo
, the screen is created, but now the jar doesn't have permission to run. What's the workaround?