This shell script just notifies you on telegram if the IP of the host machine has changed:
- curl
- Telegram bot: How do I create a bot?
Clone the repo and change directory to the downloaded folder:
git clone https://github.com/marcFernandez/ip-notifier.git && cd ip-notifierGive the script execution permissions:
chmod +x check_ip.shIn order for it to work, you just need to replace the variables noted with <YOUR_whatever> in the script. First, obtain
your bot token using @BotFather on Telegram (guide) and
replace it in the following line:
# line 8
BOT_TOKEN="<YOUR_BOT_TOKEN>"Then, retrieve your chat id by sending a message to your bot and quickly checking the url https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates, replacing <YOUR_BOT_TOKEN> by your actual token. You should see a JSON in the browser:
Replace it in the following line:
# line 17
CHAT_ID="<YOUR_CHAT_ID>"You can test it by just executing the script:
./check_ipI personally run it using a cron in my Raspberry Pi every 20min, but you can execute it using any other method.
Check my site to find more projects!

