Александр Рыжов Posted February 5, 2018 Share Posted February 5, 2018 Chat with your Keenetic CLI via Telegram like a pro!:) Install necessary Entware packages: opkg install bash curl dtach Download the bash-script, which serving as Telegram bot: curl --output /opt/bin/bashbot.sh --insecure https://raw.githubusercontent.com/ryzhovau/telegram-bot-bash/master/opt/bin/bashbot.sh curl --output /opt/bin/JSON.sh --insecure https://raw.githubusercontent.com/ryzhovau/telegram-bot-bash/master/opt/bin/JSON.sh curl --output /opt/etc/init.d/S51bashbot --insecure https://raw.githubusercontent.com/ryzhovau/telegram-bot-bash/master/opt/etc/init.d/S51bashbot chmod +x /opt/bin/bashbot.sh chmod +x /opt/bin/JSON.sh chmod +x /opt/etc/init.d/S51bashbot Ask @BotFather to create a new boot and remember auth token for it. Write down this token to TOKEN='' string at /opt/bin/bashbot.sh. Replace following string in /opt/bin/bashbot.sh *) msg="$MESSAGE";; to *) msg=$(ndmq -p "$MESSAGE" -x);; Start bot buy typing /opt/etc/init.d/S51bashbot start. This bot will start automatically on every boot. Please, keep in mind security question like authorisation, which is outside of this How-To. This is just proof-of-concept, which you can edit for your needs. Bot log can be found at /opt/var/log/bashbot.log. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.