Single-Instance Installation

Use the built-in install command when one server needs one rtmn gateway.

Install Command

Do not type the bot token directly into the command line. The following command reads the token as hidden input inside a root shell and passes it only through the environment.

Replace <CHAT_ID_1>,<CHAT_ID_2> and <LINUX_USER> with real values.

Bashsudo bash -c '
read -r -s -p "Telegram bot token: " RTMN_TELEGRAM_TOKEN
echo
export RTMN_TELEGRAM_TOKEN
exec "$1" install -chat-ids "$2" -user "$3"
' _ "$(pwd)/rtmn" "<CHAT_ID_1>,<CHAT_ID_2>" "<LINUX_USER>"

If -user is omitted, the installer uses $SUDO_USER when available.

What the Installer Does

The built-in installer performs these tasks:

  • Verifies systemd availability.
  • Validates the bot token through Telegram getMe.
  • Validates chat ID syntax.
  • Copies the binary to /usr/local/bin/rtmn.
  • Writes the root-owned environment file /etc/rtmn/env.
  • Creates the audit log path.
  • Registers and starts rtmn.service.
  • Enables automatic start on boot.

Installation Flags

FlagDescriptionDefault
-chat-idsAllowed chat IDs, comma-separatedRequired
-userLinux account that runs the shell$SUDO_USER
-shellShell path/bin/bash
-shell-argsShell argumentsEmpty
-audit-logAudit log path/var/log/rtmn/audit.log
-prefixBinary installation directory/usr/local/bin
-env-filesystemd environment file path/etc/rtmn/env
-forceBypass safety checks such as an oversized allowlistfalse

Example with Explicit Paths

Bashsudo bash -c '
read -r -s -p "Telegram bot token: " RTMN_TELEGRAM_TOKEN
echo
export RTMN_TELEGRAM_TOKEN
exec "$1" install \
  -chat-ids "$2" \
  -user "$3" \
  -prefix /usr/local/bin \
  -env-file /etc/rtmn/env \
  -audit-log /var/log/rtmn/audit.log
' _ "$(pwd)/rtmn" "<CHAT_ID_1>,<CHAT_ID_2>" "<LINUX_USER>"

Verify Installation

Bashsudo systemctl status rtmn --no-pager
sudo journalctl -u rtmn -n 100 --no-pager

A successful start sends a startup notification to every allowed Telegram chat.

Was this page helpful?

Last update