THIS REPO IS NOT MAINTAINED, CHECK NEW OPENWRT BOT ON https://github.com/filirnd/owbot
Telegram bot for router with firmware Lede/Openwrt.
- /reboot : Reboot router;
- /connected_clients : Return list of connected clients;
- /memory : Return memory (RAM) info
Telegram bot run under Lede or Openwrt firmware than the first prerequisite is to have Lede/Openwrt installed.
Second prerequisite is to have curl
package installed. You can do this with command opkg update ; opkg install curl
.
-
Get your chat_id of Telegram. If you don't know what is your chat_id you can use bot @GiveChatId_bot (Thanks to Helias). Send him /chatid command and get your chat_id;
-
Get a bot token and start your bot. If you don't know how get it you can use bot @BotFather. Send him /newbot command , name of your new bot and a username. Get the returned string "Use this token to access the HTTP API:" like this:
11334455:ArFodzmHLuasd7LY33rtfhyy4yn8qLIRt5e
Copy the files of this repo under /root/
directory of your Lede/Openwrt system.
Set files as executable with commands:
cd /root/
chmod +x -R telegrambot restart_telegram_bot telegram_bot functions/*
Copy telegrambot
file under /etc/init.d/
directory and enable it with command
cd /root/
cp telegrambot /etc/init.d/
/etc/inid.d/telegrambot enable
Set your variables (bot token and chat id) in variables
file under /root/
dir.
Enjoy your bot!
Thanks to Helias for inspiring and some helps!