CLI Reference
The cs-routeros-bouncer binary has a small command surface: it runs the bouncer, prints version/help information, or performs systemd setup/removal tasks.
Run the bouncer
Section titled “Run the bouncer”Run with a configuration file:
cs-routeros-bouncer -c /etc/cs-routeros-bouncer/cs-routeros-bouncer.yamlRuntime flags:
| Flag | Description |
|---|---|
-c | Path to the YAML configuration file |
-version | Print version, commit, build date |
When -c is omitted, the binary checks /etc/cs-routeros-bouncer/config.yaml on every run and uses it when that file exists. The resolution order is: an explicit -c path wins, then the implicit /etc/cs-routeros-bouncer/config.yaml, and if that file is missing the bouncer starts in environment-only mode (environment variables plus built-in defaults). This fallback is built into the binary, so it applies whenever the binary starts without -c — including the Docker image, whose entrypoint passes none. The systemd unit written by setup always passes an explicit -c, so it never reaches the implicit path.
Note that the implicit path is config.yaml, while setup writes its example config as cs-routeros-bouncer.yaml and passes it to the service with an explicit -c.
version
Section titled “version”Print build information:
cs-routeros-bouncer versionThe flag form is also supported:
cs-routeros-bouncer -versionInstalls the current binary as a systemd service:
sudo ./cs-routeros-bouncer setupWhat it does:
- Copies the binary to the selected install path.
- Creates the config directory.
- Writes an example config if one does not already exist.
- Writes
/etc/systemd/system/cs-routeros-bouncer.service. - Runs
systemctl daemon-reload, enables the service, and starts it.
Flags:
| Flag | Default | Description |
|---|---|---|
-bin | /usr/local/bin/cs-routeros-bouncer | Installation path for the binary |
-config-dir | /etc/cs-routeros-bouncer | Directory for configuration files |
Example with custom paths:
sudo ./cs-routeros-bouncer setup \ -bin /opt/cs-routeros-bouncer/cs-routeros-bouncer \ -config-dir /etc/cs-routeros-bounceruninstall
Section titled “uninstall”Stops and removes the systemd service and installed binary:
sudo cs-routeros-bouncer uninstallFlags:
| Flag | Default | Description |
|---|---|---|
-bin | /usr/local/bin/cs-routeros-bouncer | Installed binary path to remove |
-config-dir | /etc/cs-routeros-bouncer | Config directory to remove with -purge |
-purge | false | Also remove the configured config directory |
By default, uninstall keeps config files. If setup used a custom -bin or -config-dir, pass the same values to uninstall so the correct binary and config directory are targeted.
Remove config files too:
sudo cs-routeros-bouncer uninstall -purgePurge a custom install path:
sudo cs-routeros-bouncer uninstall \ -bin /opt/cs-routeros-bouncer/cs-routeros-bouncer \ -config-dir /opt/cs-routeros-bouncer/config \ -purgePrint usage information:
cs-routeros-bouncer helpThe usual help flags are also supported:
cs-routeros-bouncer -hcs-routeros-bouncer --help