Whatever your wget command previously was (I don't know what it was), just add this option to it.
So where is the correct dir to save this script? /jffs/scripts/ or save to /tmp/???
Reason I ask, sorry I know this seems very shallow, but you stated that this script will survive reboot, but may or will not survive flashing. I noticed at the end of the bash script that 'rm /tmp/mail.txt' is used and i'm trying to wrap my head around the file being deleted at the end of the script.
P.S. I'm learning Bash Commanding Linux at the moment, forgive me if this is a stupid question. It seems easy to pick up, Python was my first language and I added learning C programming to my list as I am playing with Arduinos and Raspberry Pi's..lol
****nevermind, about the "wrap my head around the file being deleted at the end of the script" bit. The /tmp/mail.txt file is temporarily used for the instance of reboot then removed and the wan-start script should be saved to root ?????****
Also, there seems to be a problem when attempting to make a donation when clicking on the paypal button on your website lostrealm.ca. I get as far as logging into paypal using the donation button and then paypal notifies that there was a problem and cannot make the requested donation. I give you more details if you wish.
#!/bin/sh
FROM="your-gmail-address"
AUTH="your-gmail-username"
PASS="your-gmail-password"
FROMNAME="Your Router"
TO="your-email-address"
ntpclient -h pool.ntp.org -s &> /dev/null
sleep 5
echo "Subject: WAN state notification" >/tmp/mail.txt
echo "From: \\"$FROMNAME\\"<$FROM>" >>/tmp/mail.txt
echo "Date: `date -R`" >>/tmp/mail.txt
echo "" >>/tmp/mail.txt
echo "I just got connected to the internet." >>/tmp/mail.txt
echo "" >>/tmp/mail.txt
echo "My WAN IP is: `nvram get wan0_ipaddr`" >>/tmp/mail.txt
echo "Uptime is: `uptime | cut -d ',' -f1 | sed 's/^.\{12\}//g'`" >>/tmp/mail.txt
echo "" >>/tmp/mail.txt
echo "---- " >>/tmp/mail.txt
echo "Your friendly router." >>/tmp/mail.txt
echo "" >>/tmp/mail.txt
cat /tmp/mail.txt | sendmail -H"exec openssl s_client -quiet \
-CAfile /jffs/configs/Equifax_Secure_Certificate_Authority.pem \
-connect smtp.gmail.com:587 -tls1 -starttls smtp" \
-f"$FROM" \
-au"$AUTH" -ap"$PASS" $TO
rm /tmp/mail.txt