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

Automatic Soft Reboot Bash Script

Discussion in 'HyperWRT Firmware' started by krysx24, May 2, 2005.

  1. krysx24

    krysx24 Network Guru Member


    I'm wondering if anyone knows of or can write a script
    for the linksys router that will enable it to force a soft reboot
    every X period of time.

    When I P2P my wireless kicks out to the point where I have
    to manually powercycle the router in order to get back on.
    The Hardwired PC's continue to work fine.
    I currently have the HyperWRT firmware with the G router.

    Anyway, if you know of one or can write one for whatever firmware
    that would be ultra cool and thanks in advance.

  2. jagboy

    jagboy Network Guru Member

    dd-wrt has this built into the firmware :D
  3. krysx24

    krysx24 Network Guru Member

    Uhmm ... I belive ya ... but .. it says nothing of that
    on the their official website. Would you have a link?

  4. jagboy

    jagboy Network Guru Member

  5. krysx24

    krysx24 Network Guru Member

  6. jagboy

    jagboy Network Guru Member

    that firmware is great gives you a host of options that you could not find even if you pay $20 :D
  7. krysx24

    krysx24 Network Guru Member

    not working

    The reboot scheduler didn't work for me, and yes cron was
    enabled. I donno, I had AP Watchodog enabled as well.

    I wet down in the evening and had my reboot schedualed
    for 2AM. Woke up in the morning and still down, no change
    at all.

    any tips/help apprec.

  8. dellsweig

    dellsweig Network Guru Member

    Re: not working

    Is your router getting the local time correctly??
  9. MilesTEG

    MilesTEG Network Guru Member

    I have the same problem !
    Reboot scheduled to "every days at 9h00" doesn't work !
    And my router don't give me local time...
    But when I set up to reboot every 21000 seconds, It works !!


    Is there any solution to make the "Current Time" ok ???
  10. Cyberian75

    Cyberian75 Network Guru Member

    Did you set up the NTS server?
  11. MilesTEG

    MilesTEG Network Guru Member

    heu, no I disable it, witch server should i use ? I don't know any server...
    With DD-WRT i cannot find the option !?!? where it is ?

    If I want to modify manually the date/time, witch command souild I use ??
    I don't understand the help of "date" command...
    If I want to set the time/date to "Monday 9 May 2005, 10h55" how should I proceed ??
  12. jagboy

    jagboy Network Guru Member

    try this ip
    this is a working ntp server i think. but try it anyway. do you have the right timezone setting in the router
  13. MilesTEG

    MilesTEG Network Guru Member

    Yes I have a time zone configured...
    I set it to "GMT+01:00 France, Germany..."

    Where can I put the IP you give to me in the DD-WRT ??

  14. Morpheus

    Morpheus Network Guru Member

    More NTP Servers
    set the Time IP in
    enable NTP Client and save then set the IP :wink: And save
  15. jagboy

    jagboy Network Guru Member

    it is shown here
  16. krysx24

    krysx24 Network Guru Member

    what I did to solve the issue

    WHOA .. this thread really took off.

    I set my reboot to seconds as oppose to schedualed time
    of day and that has solved my problem. I've been up
    for over 5 days now. I have it set to 21600 seconds which is
    6 hours and that's fine.

    Once again thanks to all for all the help!
  17. krysx24

    krysx24 Network Guru Member

    Re: not working

    Yes. but still for some reason it did not reboot if I set it
    a perticular hour of day. So I set to every 21600 seconds and it
    worked fine.
  18. MilesTEG

    MilesTEG Network Guru Member

    Thanks a lot !

    But i have a question again ^^

    A NTP server grab no information from the "asking client" ???
    Maybe I am not clear...
    Is the client gives more information than the "Give me hours please..." ???
  19. Judex

    Judex Network Guru Member

    I tried putting

    cp /etc/cron.d/ifstat /etc/cron.d/reboot
    echo "0 2 1 * * root /sbin/reboot" > /etc/cron.d/reboot

    to startup window in Thibor 2011 firmware. This should clear the traffic counters on a monthly basis besides rebooting the router. The file and content is created ok. I can tell you if the reboot has worked on the first day at 2:00 a.m. next month :)

    Greetings, Judex
  20. danielhaden

    danielhaden Network Guru Member

    While I really do like the Thibor firmware (it runs my own system), I do know that HyperWRT version TOFU 11 can stand a beating on peer to peer and keep right on working just fine.

    There's no reason to restart because it performs automatic maintenance every 30 minutes (so does Thibor). Tofu11 has proven extremely strong on peer to peer applications involving multiple bittorrent downloading to multiple computers while even running QOS and VOIP at the exact same time.

    If that doesn't do it, try a lamp timer to shut down your router and cable modem for a few minutes every 4:30 a.m.
  21. Judex

    Judex Network Guru Member

    I do not have any stability problems with THibor's firmware - everything is working great. This is just a way to clear traffic counters every beginning of a month so I do know how much Internet usage I have on provider side. They have some strange fair use policy on a monthly basis and sometimes make troubles.

    Did not find a better way to accomplish that yet.

    Regards, Judex
  22. LeChuck

    LeChuck Network Guru Member

    This script reboots your router...

    Hi guys,

    just wanted to give you the script, some of you were looking for:

    Put this in the startup-script:

    echo "30 3 * * * root /sbin/reboot" > /etc/cron.d/reboot

    This script reboots your router at 3:30 am every day/morning... works excellent for me... always have a "fresh" router...

    Best regards,


Share This Page