From b6485f4e5801effdc3d19dbb6d01e0636711c0fd Mon Sep 17 00:00:00 2001 From: hok7z Date: Thu, 5 Jan 2023 12:14:22 +0200 Subject: [PATCH] Added telegram-bot-api systemd unit --- systemd/config.env | 4 ++++ systemd/telegram-bot-api.service | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 systemd/config.env create mode 100644 systemd/telegram-bot-api.service diff --git a/systemd/config.env b/systemd/config.env new file mode 100644 index 0000000..13adf4b --- /dev/null +++ b/systemd/config.env @@ -0,0 +1,4 @@ +ip=127.0.0.1 +port=5326 +api_id=123 +api_hash=abcde123 diff --git a/systemd/telegram-bot-api.service b/systemd/telegram-bot-api.service new file mode 100644 index 0000000..a00356c --- /dev/null +++ b/systemd/telegram-bot-api.service @@ -0,0 +1,12 @@ +[Unit] +Description=Telegram Bot API server +After=network-online.target + +[Service] +Type=simple +EnvironmentFile=/home/q/.config/telegram-bot-api/config.env +WorkingDirectory=~ +ExecStart=/home/q/bin/telegram-bot-api --api-id=${api_id} --api-hash=${api_hash} --local --http-stat-ip-address=${ip} --http-port=${port} --dir=/home/q/.config/telegram-bot-api/ + +[Install] +WantedBy=multi-user.target