What's new

wan-start never get called

  • 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!

bogolisk

Occasional Visitor
Hi

I put a wan-start script on the router but it never get called. If I telnet in and call the script by hand then it's ok. But it never get called when wan ip changed.

Code:
admin@router:/tmp/home/root# ll -t /jffs/scripts/wan-start
-rwxrwxrwx    1 admin    root           128 May 24 11:34 /jffs/scripts/wan-start*

Code:
admin@router:/tmp/home/root# cat /jffs/scripts/wan-start
#!/bin/sh
wget -q http://freedns.afraid.org/dynamic/update.php?xxxxxxxxxxxxxxxxxxxxxx -O /tmp/freedns.out

system log
Code:
May 29 13:33:32 pppd[30651]: Connection terminated.
May 29 13:33:32 pppd[30651]: Sent PADT
May 29 13:33:32 pppd[30651]: Modem hangup
May 29 13:33:42 pppd[30651]: PPP session is 577 (0x241)
May 29 13:33:42 pppd[30651]: Connected to xx:xx:xx:xx:xx:xx via interface eth0
May 29 13:33:42 pppd[30651]: Using interface ppp0
May 29 13:33:42 pppd[30651]: Connect: ppp0 <--> eth0
May 29 13:33:43 pppd[30651]: PAP authentication succeeded
May 29 13:33:43 pppd[30651]: peer from calling number xx:xx:xx:xx:xx:xx authorized
May 29 13:33:43 miniupnpd[30733]: Failed to get IP for interface ppp0
May 29 13:33:43 miniupnpd[30733]: SendNATPMPPublicAddressChangeNotification: cannot get public IP address, stopping
May 29 13:33:43 miniupnpd[30733]: Failed to get IP for interface ppp0
May 29 13:33:43 miniupnpd[30733]: SendNATPMPPublicAddressChangeNotification: cannot get public IP address, stopping
May 29 13:33:43 pppd[30651]: local  IP address 66.36.xx.xx
May 29 13:33:43 pppd[30651]: remote IP address 204.19.xx.xx
May 29 13:33:43 pppd[30651]: primary   DNS address xx.xx.6.230
May 29 13:33:43 pppd[30651]: secondary DNS address xx.xx.54.230
May 29 13:33:43 dnsmasq[28549]: read /etc/hosts - 5 addresses
May 29 13:33:43 dnsmasq[28549]: read /etc/hosts.dnsmasq - 17 addresses
May 29 13:33:43 dnsmasq-dhcp[28549]: read /etc/ethers - 17 addresses
May 29 13:33:43 dnsmasq[28549]: using nameserver xx.xx.6.230#53
May 29 13:33:43 dnsmasq[28549]: using nameserver xx.xx.54.230#53
May 29 13:33:43 start_nat_rules: apply the nat_rules(/tmp/nat_rules_ppp0_eth0)!
May 29 13:33:43 dnsmasq[28549]: exiting on receipt of SIGTERM
May 29 13:33:43 dnsmasq[28577]: started, version 2.69 cachesize 1500
May 29 13:33:43 dnsmasq[28577]: asynchronous logging enabled, queue limit is 5 messages
May 29 13:33:43 dnsmasq-dhcp[28577]: DHCP, IP range 192.168.1.200 -- 192.168.1.254, lease time 1d
May 29 13:33:43 dnsmasq-dhcp[28577]: DHCP, sockets bound exclusively to interface br0
May 29 13:33:43 dnsmasq[28577]: read /etc/hosts - 5 addresses
May 29 13:33:43 dnsmasq[28577]: read /etc/hosts.dnsmasq - 17 addresses
May 29 13:33:43 dnsmasq-dhcp[28577]: read /etc/ethers - 17 addresses
May 29 13:33:43 dnsmasq[28577]: using nameserver xx.xx.6.230#53
May 29 13:33:43 dnsmasq[28577]: using nameserver xx.xx.54.230#53
May 29 13:33:43 rc_service: ip-up 28557:notify_rc stop_upnp
May 29 13:33:43 miniupnpd[30733]: shutting down MiniUPnPd
May 29 13:33:43 rc_service: ip-up 28557:notify_rc start_upnp
May 29 13:33:44 miniupnpd[28593]: HTTP listening on port 35400
May 29 13:33:44 miniupnpd[28593]: Listening for NAT-PMP/PCP traffic on port 5351
May 29 13:33:47 WAN Connection: WAN was restored.

any idea?

--
bogo
 
Last edited:
any idea how to debug this? can anyone point me to the place where wan-start get called? /etc/xxx???? or /rom/etc/xxx ???

Thanx
 
Start by writing a message to syslog at the beginning of your script to see if it is being executed.

Code:
#!/bin/sh

logger -t $(basename $0) $1

wget -q http://freedns.afraid.org/dynamic/update.php?xxxxxxxxxxxxxxxxxxxxxx -O /tmp/freedns.out
 
Start by writing a message to syslog at the beginning of your script to see if it is being executed.

Code:
#!/bin/sh

logger -t $(basename $0) $1

wget -q http://freedns.afraid.org/dynamic/update.php?xxxxxxxxxxxxxxxxxxxxxx -O /tmp/freedns.out

Wow, just adding that line make it work!!! must be a timing thing. Maybe ppp0 is not fully functional when wan-start got called and calling logger made it work by adding a delay.

Thank you very much.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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

Staff online

Top