I have OpenWRT router, installed msmtp. I would like to write a command line (or a .sh file) that would send me the current public IP address, and let Cron execute it every 15 Min.
I found the posting: Run a command and email the output
and tried to do the same with msmtp, and it did work: I did the following
kdig +short myip.opendns.com @resolver1.opendns.com | msmtp
xxxxxxxx@gmail.com
and got an email with the current public IP address, but without a subject, of course, because I didn’t set anything. Now, for msmtp, the way to put a subject is
echo “Subject: Current Public IP” | msmtp xxxxxxx@gmail.com
But I have no idea how I could combine these two things…. I would appreciate your help very much !