rcon − command line source rcon client
rcon [options] command
rcon can be used as a command line remote console client for source game servers. It supports a configuration file to safely store your rcon passwords. It will execute the command given, or - if no command is given - will read a list of commands from standard input.
−c −−config filename
Specify an alternate path to the configuration file. Default is $HOME/.rconrc
−d −−debug
Enable debug mode. Sent and received packages are shown on terminal.
−h −−help
Usage
−H −−host hostname
Hostname or IP address of the server
−m −−minecraft
Minecraft compability mode.
−n −−nowait
Do not wait for a reply from the server, just send and quit.
−p −−port port
Port or service name
−P −−password password
Remote console password of the server
−s −−server name
Use this server from the configuration file
˜/.rconrc
The default configuration filename for rcon.
The configuration file must be in the key file format (commonly known as INI file) and adhere to the following schema:
[myserver]
hostname = 173.43.63.111
port = 27003
password = somepass
# remove the line below if it the server is not minecraft
minecraft = true
This server can then be used from the command line with the -s parameter:
rcon -s myserver status
The command line still trumps the configuration file, so the following would override the port to 27010:
rcon -s myserver -p 27010 status
rcon can also be used as script interpreter. Just specify the rcon binary in the she bang. Lines starting with a hash sign are ignored, other non-empty lines are being treated as commands. The following script runs two commands:
#!/usr/bin/rcon -s myserver
# Query status
status
# List plugins
sm plugins list
Send status to a server with given IP, port and password:
rcon -H 173.43.63.11 -p 27003 -P somepass status
Send a patch of commands to server:
echo -e "status\nsm plugins list" | rcon -s myserver
Report bugs at https://github.com/n0la/rcon
Copyright (c) 2016 Florian Stinglmayr <[email protected]>