Added mc-send-to-console as rcon/attach alternative

#1071
This commit is contained in:
Geoff Bourne
2021-10-09 11:34:37 -05:00
parent 1d41593a84
commit c3cf892e40
6 changed files with 49 additions and 27 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
: "${CONSOLE_IN_NAMED_PIPE:=/tmp/minecraft-console-in}"
if [ $# = 0 ]; then
echo "ERROR: pass console commands as arguments"
exit 1
fi
if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then
echo "ERROR: named pipe ${CONSOLE_IN_NAMED_PIPE} is missing"
exit 1
fi
echo "$@" > "${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}"