Git Product home page Git Product logo

rcon's Introduction

Build Status

rcon

rcon is a command line application that can be used as a Source RCON client. It will send commands to the given server, and print the reply to stdout.

Installation

You require libbsd, check, cmake and glib-2.0 to successfully build rcon. You have to install those from your distribution's repository. So for example on Debian you'd do something like this:

$ apt-get install build-essential cmake check libbsd-dev libglib2.0-dev

Then build the project:

$ mkdir build
$ cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
$ make
$ sudo make install

A bash-completion script is available, but not installed by default. If you use bash completion simply specify INSTALL_BASH_COMPLETION=ON on the cmake command line:

$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DINSTALL_BASH_COMPLETION=ON

Documentation

The utility comes with a man page: rcon(1). View it with: man 1 rcon.

Usage

Command Line

The command can be called from the command line directly, like so:

$ rcon -H somehost -p someport -P somepass status

rcon automatically concats all your arguments together into one command:

$ rcon -H somehost -p someport -P somepass sm plugins list

This sends the command "sm plugins list" to the server.

Standard Input

If you wish to send more than one command to the server, don't specify one on the command line. Instead give rcon a list of commands through standard input:

$ rcon -H somehost -p someport -P somepass <<EOS
status
sm plugins list
# This might be long!
cvarlist
EOS

In this mode lines starting with # are ignored. This allows rcon to be used as a script interpreter. Just pass it the script file through stdin:

$ cat somescript.txt
# This is a comment
status

# and this too!
sm plugins list

cvarlist

And execute your script like this:

$ rcon -H somehost -p someport -P somepass < somescript.txt
# Or:
$ cat somescript.txt | rcon -H somehost -p someport -P somepass

Exit Code

The command exit with 0 on success, and some arbitrary non-zero exit code on failure.

Config file

You can also store your server credentials in a configuration file. The default location for this file is $HOME/.rconrc. You can specify an alternate configuration file through the -c option. Entries from this configuration file are referenced through the -s option.

Here is an example configuration file:

[somehost]
hostname = 174.53.163.41
port = 27045
password = somepass

Now you can do:

$ rcon -s somehost status

See Also

rcon's People

Contributors

n0la avatar tamamcglinn avatar yostinso avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.