I am running a minecraft server in a screen session. I also am using a named pipe in order to send commands to the minecraft server from other scripts.
I can see output from the server in the screen session, however I cannot enter any. I expected this anyway since I am taking input from the named pipe.
Here’s the line I run to start everything:
screen -S minecraft sh startup.sh
Here’s startup.sh:
#!/bin/bash
rm mct
if [ ! -p mct ]; then
mkfifo mct && chmod 0777 mct
fi
tail -f mct | java -Xincgc -Xmx2048M -jar minecraft_server.jar
I want to be able to enter commands from the screen session and from the named pipe. Is there a way I can accomplish this? I’m just now messing around with bash scripts, been learning a lot about it today. I just can’t seem how to do this.
One approach is to run your
tail -f mctconcurrently with a command that reads from the console and writes to the same anonymous pipe: