#!/bin/sh
sendmail -H"exec openssl s_client -quiet \
-CAfile /opt/home/root/cert/Equifax_Secure_Certificate_Authority.pem \
-connect smtp.gmail.com:25 -tls1 -starttls smtp" \
-f"my_address@gmail.com" \
-au"my_address@gmail.com" -ap"my_gmail_password" $1
#!/bin/sh
FROM="router@domain.com"
AUTH="account@gmail.com"
PASS="gmail_passowrd"
FROMNAME="Your Router"
TO="you@domain.com"
echo "Subject: WAN state notification" >/tmp/mail.txt
echo "From: \"$FROMNAME\"<$FROM>" >>/tmp/mail.txt
echo "Date: `date -R`" >>/tmp/mail.txt
echo "I just got connected to the Interwebz." >>/tmp/mail.txt
echo "My new IP is: `nvram get wan0_ipaddr`" >>/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 /opt/home/root/cert/Equifax_Secure_Certificate_Authority.pem \
-connect smtp.gmail.com:25 -tls1 -starttls smtp" \
-f"$FROM" \
-au"$AUTH" -ap"$PASS" $TO
rm /tmp/mail.txt
connect: Connection timed out
connect:errno=145
sendmail: helper exited (1)
wait just figured it out. smtp.gmail.com:25 didnt work for me it kept timing out. using smtp.gmail.com:587 worked for mr#!/bin/sh
FROM="xxxx@gmail.com"
AUTH="xxxx@gmail.com"
PASS="xxxx2"
FROMNAME="Your Router"
TO="xxxx@gmail.com"
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:25 -tls1 -starttls smtp" \
-f"$FROM" \
-au"$AUTH" -ap"$PASS" $TO
rm /tmp/mail.txt
#!/bin/sh
FROM="x@gmail.com"
AUTH="x@gmail.com"
PASS="x
FROMNAME="Router RT-N66R"
TO="x@gmail.com"
ntpclient -h pool.ntp.org -s &> /dev/null
sleep 5
echo "Subject: Router RT-N66R" >/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 "Syslogs: `cat /tmp/syslog.log | less`" >>/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
great script, can we get vpn status/ip?
printf "Subject: $SUBJECT\nFrom: RT-N66U<noreply@mydomain.com>\n\n$MESSAGE" | sendmail \
-H"exec openssl s_client -quiet -connect email-smtp.us-east-1.amazonaws.com:465" \
-f"noreply@mydomain.com" \
-au"$xxxxxxxxxxxxxxxxxxxx" \
-ap"$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
me@mydomain.com
SUBJECT="My subject"
MESSAGE="My message line 1\nLine 2 of my message\nLine 3 of my message"
printf "Subject: $SUBJECT\nFrom: RT-N66U<noreply@mydomain.com>\n\n$MESSAGE" | sendmail \
-H"exec openssl s_client -quiet -connect email-smtp.us-east-1.amazonaws.com:465" \
-f"noreply@mydomain.com" \
-au"$xxxxxxxxxxxxxxxxxxxx" \
-ap"$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
me@mydomain.com
printf "Subject: $SUBJECT\nFrom: RT-N66U<noreply@mydomain.com>\n\n$MESSAGE" | sendmail \
-H"exec openssl s_client -quiet -connect email-smtp.us-east-1.amazonaws.com:465" \
-f"noreply@mydomain.com" \
-au"$xxxxxxxxxxxxxxxxxxxx" \
-ap"$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-v me@mydomain.com
Sorry for this newbie question, but how exactly can I copy a script to this '/jffs/scripts' location? How can I access, e.g. view, this location in general. Do I need a separate tool/utility for it? (I am on a Win7 machine.)
TIA!
Thread starter | Title | Forum | Replies | Date |
---|---|---|---|---|
L | Feature suggest: web notifications | Asuswrt-Merlin | 1 | |
Notifications when device goes online/offline | Asuswrt-Merlin | 0 | ||
H | Do AiProtectipn Email Notifications Actually Work? | Asuswrt-Merlin | 10 | |
Google mail vpn blocking | Asuswrt-Merlin | 7 |
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!