Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to make a startup script for my Minecraft severs but I can't figure out how to: If the session "Server1" exists, run a command in it, if it doesn't, create the session and then run the command.

I have read something about a -dRR switch but haven't been able to use it.

The script is java -Xmx 128M spigot.jar -o true BTW.

EDIT: This is te command I've been using (can only run it once otherwise it will create news seesions) screen -dmS Server3 bash -c '/home/server/Minecraft/BungeeCord/Server3/start.sh; exec bash' The start.sh file contains the above code.

Of course I tried to change the switch from -dmS to -dRR, but that didn't work.

share|improve this question
welcome to Stack Exchange! this is not a free help desk. we're happy to help, of course, but please show what you have tried. for example, what screen command have you tried? what do you mean when you say you can't use the -dRR switch? – strugee Feb 9 '14 at 22:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.