Can you improve my Startup script?

Discussion in 'HyperWRT Firmware' started by eq2675, Jul 20, 2006.

  1. eq2675

    eq2675 Network Guru Member

    The objective of this part of my Startup script was to obtain a new dynamic IP address from my ISP each night at around 2:35 AM without resetting the router. A simple reboot of the router would not cause the DSL line to be down long enough in most cases to obtain a new IP anyway.

    If I just brought down ppp0, any activity on the local side would immediately bring it back up, not leaving it down long enough top get assigned a new IP.

    Is there a way to trim up these commands or does this look OK?

    echo "35 2 * * * root /sbin/ifconfig eth0 down" > /etc/cron.d/eth0down
    echo "36 2 * * * root /sbin/ifconfig ppp0 down" > /etc/cron.d/ppp0down
    echo "40 2 * * * root /sbin/ifconfig ppp0 up" > /etc/cron.d/ppp0up
    echo "41 2 * * * root /sbin/ifconfig eth0 up" > /etc/cron.d/eth0up

  2. bsantos

    bsantos Guest

    I don't know if it makes sense to your needs, but for a pppoe connection I'm killing pppoecd, which is auto restarted... it works here. :)
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice