Skip to content

Instantly share code, notes, and snippets.

@inertia186
Created March 18, 2014 01:19
Show Gist options
  • Save inertia186/9611817 to your computer and use it in GitHub Desktop.
Save inertia186/9611817 to your computer and use it in GitHub Desktop.
#!/bin/bash
## A small wrapper around the mcrcon binary.
##
## See: https://forums.bukkit.org/threads/admin-rcon-mcrcon-remote-connection-client-for-minecraft-servers.70910/
MC="/path/to/server"
RCON_EXEC="$MC/scripts/gits/mcrcon-code/mcrcon"
RCON_HOST="127.0.0.1"
RCON_PORT=25577
RCON_PASS=password
if [ -z "$1" ]; then
# Interactive usage.
$RCON_EXEC -c -H $RCON_HOST -P $RCON_PORT -p $RCON_PASS -t
else
# Send a single command and return the response.
cmd="$@"
$RCON_EXEC -c -H $RCON_HOST -P $RCON_PORT -p $RCON_PASS "$cmd"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment