1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script for PPPoE Restart or router reboot

Discussion in 'HyperWRT Firmware' started by PROD_PT, Feb 12, 2007.

  1. PROD_PT

    PROD_PT LI Guru Member

    Hi,

    can someone help with the command I need to insert in the Startup Script in order to have the PPPoE connection reboot at a specific hour?
    If I cannot just restart the PPPoE connection, then a full router reboot will also do.

    I've seen someone ask the same in this forum before, but it looked like the
    echo "00 6 * * * root /sbin/reboot" > /tmp/cron.d/restart
    did only work in Thibor 14 and not in 15c (the one I have)
     
  2. PROD_PT

    PROD_PT LI Guru Member

    Ok, I searched a lot more and found that

    echo '55 2 * * * root killall -HUP pppoecd' > /tmp/cron.d/ppprecon

    does the trick to restart the connection at 2.55AM.

    Now, what I do not understand (but my knowledge of LINUX is close to zero) is why does it not work when I put two different times, e.g.

    echo '25 1 * * * root killall -HUP pppoecd' > /tmp/cron.d/ppprecon
    echo '55 7 * * * root killall -HUP pppoecd' > /tmp/cron.d/ppprecon

    if I want the connection to restart daily at 1.25AM and 7.55AM.

    Any ideas?
     
  3. frenchy2k1

    frenchy2k1 LI Guru Member

    it's your shell command.
    ">" is a destructive redirector. It directs the output of your command (in this case a simple echo, that print the command) into a NEW file with the name you give.
    In this case, you overwrite with the 2nd line (erase old file and create a new file with new time) the first one.
    Use the "append" redirector for the 2nd line: ">>".

    echo '25 1 * * * root killall -HUP pppoecd' > /tmp/cron.d/ppprecon
    echo '55 7 * * * root killall -HUP pppoecd' >> /tmp/cron.d/ppprecon
     
  4. PROD_PT

    PROD_PT LI Guru Member

    Thanks Frenchy2k1. That solved the problem!
     
  5. bigclaw

    bigclaw Network Guru Member

    Were you able to make router reboot work too?
     
  6. PROD_PT

    PROD_PT LI Guru Member

    I never tried the reboot, as my preference was really to just restart the PPPoE connection. If that didn't work, then I would have tried it.
     

Share This Page