Simple bash script that allows for Pushbullet notifications to mobile/desktop apps whenever a remote IP changes. Useful for SSHing remote home connections that have dynamically-assigned IP's. Originally made so I could manage a relatives home media server remotely, for anything else use a Dynamic DNS.
This example is with Pushbullet but you can use alternative notification services so long as they support API calls.
- Create an account with Pushbullet
- Install their mobile app or desktop/browser extension
- On your remote machine, in any directory of your choosing, use:
wget -L https://raw.githubusercontent.com/ckbaudio/pushbullet_ip_notify/main/pb_ipcheck.sh
- Create a token in Pushbullet
- Paste your token inside
pb_ipcheck.sh
via replacingpbapi="ur_token_here"
- Additionally, you can change the location of the ip.txt (default is script location).
- Make the script executable:
sudo chmod +x pb_ipcheck.sh
- Create a scheduled task as root via
sudo crontab -e
with0 */6 * * * ./home/usrname/pb_ipcheck.sh
- This example will run a check every 6 hours