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.json
and 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 build
and run it:
$ ./telegram-bot-systemd
$ sudo cp systemd/telegram-bot-systemd.service /lib/systemd/system/
$ sudo vi /lib/systemd/system/telegram-bot-systemd.service
and edit User, Group, WorkingDirectory and ExecStart values.
It will launch automatically on boot with:
$ sudo systemctl enable telegram-bot-systemd.service
and will start with:
$ sudo systemctl start telegram-bot-systemd.service
TODO
MIT