Just flashed the download on my "production router", found the syntax of the Busybox 1.14.3 sendmail has changed slightly since I last checked - here is a script that successfully uses the latest version, change all the <..> to suit, works with a standard ISP that accepts standard email post on port 25
Code:
#!/bin/sh
# ----------------------------------------------------------
# bootmsg.sh
# Script to send an email whenever the router is (re)booted.
# ----------------------------------------------------------
#===============================
FROM=<fromemail@address>
TO=<toemail@address>
NAME=<name>
SMTP=<smtp.yourisp>
SUB="Router reboot"
MSG="/var/msg.txt"
#===============================
# write the email headers
cat >$MSG<<EOF
From: $FROM
To: $TO
Subject: $SUB
Date: $(date)
Hello $NAME
The router has booted up (or has been rebooted) on: $(date)
I just thought I'd notify you.
Here's the new ISP IP details
$(ifconfig ppp0 |grep inet)
and the connection stats
$(cat /proc/avalanche/avsar_modem_stats)
Best regards,
Your beloved router.
EOF
# send the email
sendmail -S $SMTP -f $FROM <msg.txt
logger "bootmsg sent"
# cleanup
# rm $MSG