With this bot, you can systemctl is-active/start/stop services remotely.
Install Go and generate your Telegram bot's API token.
$ go get -d github.com/meinside/telegram-bot-systemd
$ cd $GOPATH/src/github.com/meinside/telegram-bot-systemd
$ cp config.json.sample config.json
$ vi config.jsonand edit values to yours:
{
"api_token": "0123456789:abcdefghijklmnopqrstuvwyz-x-0a1b2c3d4e",
"available_ids": [
"your_telegram_id",
"other_whitelisted_id"
],
"controllable_services": [
"vpnserver",
"minecraft-server"
],
"monitor_interval": 1,
"is_verbose": false
}$ go buildand run it:
$ ./telegram-bot-systemd$ sudo cp systemd/telegram-bot-systemd.service /etc/systemd/system/
$ sudo vi /etc/systemd/system/telegram-bot-systemd.serviceand edit User, Group, WorkingDirectory and ExecStart values.
It will launch automatically on boot with:
$ sudo systemctl enable telegram-bot-systemd.serviceand will start with:
$ sudo systemctl start telegram-bot-systemd.serviceTODO
MIT