I wrote a simple script to launch two minecraft servers through screen. I can run it fine, but the issue is it hits the first command and runs that line fine, but it then enters the screen it creates and goes to the server without ever launching the second line. How can I force it to launch both commands?
Here is the script:
#!/bin/bash
#Launches minecraft servers
#Plugin Test Server
screen -S PluginTest java -Xms1024M -Xmx1024M -XX:MaxPermSize=128M -jar /home/kalenpw/TestWorld/spigot-1.10.jar
#Khalidor Server
screen -S Khalidor java -Xms8192M -Xmx9216M -XX:MaxPermSize=128M -jar /home/kalenpw/KhalidorServer/spigot-1.10.jar
What happens is the first PluginTest runs fine, but the second line for Khalidor never runs.
If you add '&' to the end of the first command it will allow the second command to run. So change the first command to:
The '&' causes the command to be run in the background. If you add one to the end of the second command as well you will be returned to a prompt after running your script, and both of your commands will be running in the background. You will be able to see them by running the 'jobs' command.