I've wrote python script to notify me if there is change to public IP of my raspberry pi, and if there is to notify me via encrypted email. I might post code later on Github, someone might find it usefull

@nikolal Untested, rudimentary, invokes external software (curl, s-nail and gpg), possibly not compatible with PGP emails expected by existing software… but I think this should work:

#!/usr/bin/env python2 import os, sys def changed(new_ip, recipient): with open("ip", "w") as f: f.write(new_ip) os.system("gpg --trust-model=always -ea -r " + recipient + " - < ip | mail -s ip_has_changed " + recipient) try: with open("recipient") as f: recipient = f.read() except Exception: print('could not read recipient') sys.exit(1) try: with open("ip") as f: old_ip = f.read() except Exception: old_ip = None new_ip = os.popen("curl ipconfig.sh").read() if old_ip != new_ip: changed(new_ip, recipient)

Configure with echo -n some@email.address > recipient.

Pardon any typos. Probably usable in cron.

Follow

@ivan
I've done it with this significant difference: I'm using smtp with email and password plaintext written in code to send previously encrypted (with gnupg) message, I'm authenticating with TLS with external provider (e.g GMail). I'll edit code soon and will send you link

Sign in to participate in the conversation
Mastodon 🔐 privacytools.io

Fast, secure and up-to-date instance. PrivacyTools provides knowledge and tools to protect your privacy against global mass surveillance.

Website: privacytools.io
Matrix Chat: chat.privacytools.io
Support us on OpenCollective, many contributions are tax deductible!