summaryrefslogtreecommitdiff
path: root/rconsole/rconsole-input
diff options
context:
space:
mode:
Diffstat (limited to 'rconsole/rconsole-input')
-rwxr-xr-xrconsole/rconsole-input9
1 files changed, 9 insertions, 0 deletions
diff --git a/rconsole/rconsole-input b/rconsole/rconsole-input
new file mode 100755
index 0000000..3fe076e
--- /dev/null
+++ b/rconsole/rconsole-input
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+trap 'screen -S "$RCONSOLE_SCREEN" -X quit; exit' SIGINT
+
+PROMPT="(rcon@$RCONSOLE_INSTANCE) "
+
+while read -e -p "$PROMPT" line; do
+ printf "$line\n" > "$RCONSOLE_PIPE"
+done