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

Does sleep override PPPoE Keep Alive?

Discussion in 'Tomato Firmware' started by yaqui, Jun 7, 2007.

  1. yaqui

    yaqui LI Guru Member

    Will this sleep command in a script override (for 10 minutes) the keep alive setting in the gui?

    killall -hup pppoecd
    sleep 600

    So after 10 minutes will it reconnect?
  2. roadkill

    roadkill Super Moderator Staff Member Member

    I think it does..
  3. Odin-60

    Odin-60 LI Guru Member

    I'd say it won't, but why don't you simply try it out?
    Doing so will certainly not brick your router :cool:
  4. yaqui

    yaqui LI Guru Member

    Why won't this work... I made a file reconnect.sh uploaded it to /jffs/reconnect
    with this inside:

    killall -hup pppoecd
    sleep 600

    Then I put this under init script to execute it at 6am:
    cru a reconnect "00 06 * * * /jffs/reconnect/reconnect.sh"

    In the log it looked like at 6 am it executed reconnect.sh but didn't do anything!
    Why won't this work?? I want it to shutdown the connection for 10 minutes then reconnect
  5. yaqui

    yaqui LI Guru Member

  6. yaqui

    yaqui LI Guru Member

    Aggggggggghhhh in telnet it says there is no command keepalive
  7. Odin-60

    Odin-60 LI Guru Member

    Because the meaning of "sleep 600" is: "Dear computer, please
    wait for 10 minutes before executing the next command in this

    It does not mean: "Dear computer, please don't do anything at
    all for the next 10 minutes."

    Do you understand the difference?
  8. yaqui

    yaqui LI Guru Member

    Well WHAT command does mean that then ?? This seems like a really simple thing I want to do, I can't believe it is this difficult.
  9. Odin-60

    Odin-60 LI Guru Member

    There is no such command. (We are in a multitasking environment!)

    What you actually need to do is
    1) to turn off the WAN connection in a way so that
    it is not restarted automatically;
    2) sleep 600;
    3) turn on WAN again.

    I suggest to try out something like

    service wan stop
    sleep 600
    service wan start

    Please, verify that the virtual WAN interface is still PPP0 afterwards.
    In case a new virtual WAN interface named "PPP1" is created, forget
    my suggestion.
  10. yaqui

    yaqui LI Guru Member

    So, in theory 'service wan stop' should override 'keep alive'

    And I should check wan_iface=ppp0

    service wan stop,
    waited about 2 minutes,
    service wan start

    checked 'nvram show|sort|more' and wan_iface is still ppp0

    appears as if it should work?
  11. Odin-60

    Odin-60 LI Guru Member

    In practice; I've just tried it out: My redial period is 30 secs.
    After issueing 'service wan stop' and waiting for more than a
    minute, the WAN connection was still down.

    I don't know... Just take a look at the bandwidth graph; if you
    can select PPP1 beside PPP0, something is wrong. (This happened
    to me once when I was playing around with 'service wan ...'; in
    fact I do not really expect it to happen in your case.)
  12. yaqui

    yaqui LI Guru Member

    What if the time update interval occurs when wan is stopped? Will that inniate a new virtual WAN interface? Or does 'service wan stop' override that also?
  13. yaqui

    yaqui LI Guru Member

    I don't think time update will, but just wanted to be sure. I have the same results as you with stopping wan and waiting for ~2 min.
  14. Odin-60

    Odin-60 LI Guru Member

    Why should anything happen at all?
    The ntp client does not get a connection, that's it.
  15. yaqui

    yaqui LI Guru Member

    Thanks. I didn't know if it was set to trigger a connection and start up wan interface somehow. does it?

Share This Page