What's new

WAN-START script runs by itself every 3 hours

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Marcelo Linardi

New Around Here
Hi All,
Thanks in advance for reading this post.

I am running Asus WRT Merlin v 378.53 on my RT-AC66u and script " wan-start" runs exactly ( by itself ) every 3 hours.

I am not seeing "WAN Connection: WAN was restored" message after or before wan-start script runs.

This is wan-start content:

#!/bin/sh

DATE=$(date +"%Y-%m-%d-%H%M%S")
#mkdir -p logs
touch /jffs/scripts/logs/$DATE-WAN-start

SMTP="My SMTP server"
FROM="my email address"
FROMNAME="ASUS ROUTER"
TO="my email address"

ntpclient -h pool.ntp.org -s &> /dev/null
sleep 60
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 | /usr/sbin/sendmail -S"$SMTP" -f"$FROM" $TO -au"my id" -ap"my passw"
rm /tmp/mail.txt



cat syslog.log |grep wan-start shows:

May 19 00:42:47 custom script: Running /jffs/scripts/wan-start (args: 0)
May 19 03:42:48 custom script: Running /jffs/scripts/wan-start (args: 0)
May 19 06:42:50 custom script: Running /jffs/scripts/wan-start (args: 0)
May 19 09:42:52 custom script: Running /jffs/scripts/wan-start (args: 0)
May 19 12:42:53 custom script: Running /jffs/scripts/wan-start (args: 0)
May 19 15:42:55 custom script: Running /jffs/scripts/wan-start (args: 0)
May 19 18:42:57 custom script: Running /jffs/scripts/wan-start (args: 0)
May 19 21:42:59 custom script: Running /jffs/scripts/wan-start (args: 0)


Any idea what can be going on?

BIG THANKS !
 
What is the duration of the DHCP lease your ISP gives you?
 
What is the duration of the DHCP lease your ISP gives you?

Sorry for my late response. You made a good question... but, I have no idea on how to get this info. ISP tech support is HORRIBLE, and I can´t ask it to them.

What I can tell you is that as sudden as it started, it stopped. Now, I upgraded to 378.55 and 3 hours after upgraded, script started to run itself back again.

If you have any clue, will help a lot.

Thanks in advance,
 
Check the router System Log, you should find something like this:

Jun 23 14:57:15 dhcp client: bound xxx.xxx.xxx.xxx via xxx.xxx.xxx.xxx during 1800 seconds.

1800 seconds is the lease time my ISP sets.
 
Hi !, today´s log is showing:

Jul 25 00:05:08 dhcp client: bound xxx.xxx.xxx.xxx via xxx.xxx.xxx.xxx during 600 seconds.

BUT, on main page --> internet status ( click over the world ) says Lease time 6 hours...

I am having the issue every 3 hours :(

Is there any way to have a deeper log???

Thanks !
 
BUT, on main page --> internet status ( click over the world ) says Lease time 6 hours...

I am having the issue every 3 hours :(
That sounds like the correct behaviour then. It is a common practice for clients to renew their leases about half way through their duration.

FYI - My ISP gives me a lease of 5 days.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top