Reputation: 2445
Context: I have a minecraft server running in the background, but I cannot access any of the server commands because it is running in the background... If know the PID of the process, is there any way to give the server commands in the running thread? Some research suggested named pipes, but I am not sure if that is correct or how to use them in this example.
What I am looking to do: Issue commands to currently running minecraft server. Something like: ban playerName | 28013
Upvotes: 0
Views: 303
Reputation: 17155
While I don't know anything about minecraft server, if it's accepting commands from stdin, you should be able to use the named pipe concept.
mkfifo minecraft_in
whatever_command_to_start_mincraft < minecraft_in > minecraft_out 2>&1 &
Then whenever you want to send anything to the process:
echo "Command" > mincraft_in
Upvotes: 1