Awesome
LinuxExecBot
Telegram bot to execute a command from a configurable list on your Linux machine
1. Installation
2. Usage
3. Options
1. Installation
From .deb repository (recommended)
curl -s --compressed "https://aceberg.github.io/ppa/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/aceberg.gpg
sudo curl -s --compressed -o /etc/apt/sources.list.d/aceberg.list "https://aceberg.github.io/ppa/aceberg.list"
sudo apt update && sudo apt install linuxexecbot
From .deb file
Download latest release, install with your package maneger
From .tar.gz
Download latest release, then
tar xvzf LinuxExecBot-*.tar.gz
cd LinuxExecBot
sudo ./install.sh
With go
go install github.com/aceberg/LinuxExecBot/cmd/LinuxExecBot@latest
2. Usage
As root
- Edit
/etc/LinuxExecBot/config.yaml
, put your Telegram bot's Token and ChatID there. Add your commands. Example:
config:
token: 5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#id: 111111111
ids: # Use either id (for one user) or ids (for several bot users)
- 111111111
- 222222222
args: no # If set to "yes", allows to send arguments with bot commands
# WARNING! Could be dangerous, if someone gets access to your bot
commands:
- name: la
exec: "ls -al"
desc: "List all files"
- name: ping
exec: "ping -c 3 8.8.8.8"
desc: "Ping Google DNS"
Only commands with not empty
desc
field will be shown in Bot Menu.
/help
command lists all available commands
- Enable and start service
systemctl enable linuxexecbot.service
systemctl start linuxexecbot.service
- Go to your bot in Telegram and try to execute command. Example:
/la
As user
- Copy config example
mkdir -p ~/.config/LinuxExecBot
cp /etc/LinuxExecBot/config.yaml ~/.config/LinuxExecBot/config.yaml
- Edit
config.yaml
, put your bot's Token and ChatID there - Enable and start service, replace
MYUSER
with your username
systemctl enable linuxexecbot@MYUSER.service
systemctl start linuxexecbot@MYUSER.service
- Go to your bot in Telegram and try to execute command.
3. Options
Key | Description | Default |
---|---|---|
-c | Path to config yaml file | config.yaml |