Question on iface hotplug script logic

Hi guys, I've a recurring problem with my ISP.

Sometimes after router reboots or when the ISP forces a reconnect, my router cannot connect with PPPoE. In the logs I see "Timeout waiting for PADO packets" when that happens. When this is the case, 1 or 2 network restarts usually deals with this.

So I looked at other some older threads and came upon a script that originally rebooted the router when these error messages appear. I've modified it to restart the network instead:

# if router has been up for at least 3 minutes...
[ `sed 's/[. ].*//' /proc/uptime` -gt 180 ] && {
    # restart network if any "Timeout waiting for PADO packets" log messages seen
    [ `/sbin/logread -e 'Timeout waiting for PADO packets' | wc -l` -gt 1 ] && /etc/init.d/network restart

}

I've placed this script in /etc/hotplug.d/iface.

Help me with the logic - does the script only run on reboot, or EVERY TIME these error messages appear in the logs? Thanks :slight_smile:

only at reboot

if request make crontab

1 Like

Thanks so much! How would you modify this script so that it fires every time the PADO timeout error appear in the logs AND the WAN interface wan is disconnected for at least 2 mins?

2 Likes

Never mind, I've adapted the info in post below to restart the network if PADO errors appear in the log.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.