The Rust version of get-LAN-IP-telegram-bot.
The original project is developed for Raspberry Pi. This saves me much time from IP checking.
But, I'm not sure why the Python virtual environment can't get IP when RPi just booted. I resolved it with a stupid way: delay.
This actually work. However, I need to keep waiting even device had booted until message delivered.
Now, I migrate this project to Rust, and it seems more fast and reliable in my case.
You can use environment variables or dotenv.
export TOKEN='bot token'
export NOTIFY_USER_ID='chat id'
cp .env.example .env
then replace value for your bot and chat/user id.
※ The .env
file should be placed same or parent dir with executable binary file.
First, build binary or download pre-built binary from release page.
Optional, you can rename it to get-LAN-IP-telegram-bot-rs
or other filename you like.
Add the following line into /etc/rc.local
:
(cd /path/to/binary && ./get-LAN-IP-telegram-bot-rs; cd -)&
Don't forget that replace get-LAN-IP-telegram-bot-rs
with you just named to binary