Router restart script

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
beat
DD-WRT Novice


Joined: 18 Jun 2006
Posts: 11

PostPosted: Wed Jun 21, 2006 0:38    Post subject: Router restart script Reply with quote
Hi.
I wonder if anyone knows if it is possible to add a script to the router for it to restart at a certain hour.
I tried adding this lines on the startup script:

echo "10 1 * * * root /sbin/reboot" > /etc/cron.d/restart
echo "50 7 * * * root /sbin/reboot" > /etc/cron.d/restart

but it didn't work. i want the router to restart at 1:10 AM and 7:50 AM.

Also congratulations BS for this great firmware, i'll donate as soon as i get my credit card :)

Note: Forgot to say i'm using DD-Wrt v23SP1
Sponsor
colindean
DD-WRT User


Joined: 08 Jun 2006
Posts: 59
Location: Pittsburgh, PA

PostPosted: Wed Jun 21, 2006 0:47    Post subject: Reply with quote
In the control panel, go Administration > Keep Alive. There you will find that which you seek.
_________________
PittMesh, a Meta Mesh Wireless Communities project.
Mi parolas Esperanton.
beat
DD-WRT Novice


Joined: 18 Jun 2006
Posts: 11

PostPosted: Wed Jun 21, 2006 0:49    Post subject: Reply with quote
yes i know. but there i can only set one hour! i want it to reboot at 1:10AM and then again at 7:50AM. :?

also is there anyway to check the uptime of my adsl connection? the router is making a pppoe connection from another router on 192.168.0.1.
colindean
DD-WRT User


Joined: 08 Jun 2006
Posts: 59
Location: Pittsburgh, PA

PostPosted: Wed Jun 21, 2006 3:28    Post subject: Reply with quote
*shrug*

Someone with a little more knowledge of cron's gonna have to pick this one up.

_________________
PittMesh, a Meta Mesh Wireless Communities project.
Mi parolas Esperanton.
ghost48
DD-WRT User


Joined: 07 Jun 2006
Posts: 51

PostPosted: Wed Jun 21, 2006 12:50    Post subject: Reply with quote
Just take a closer look into the WIKI and you should be good to go.
wlan
DD-WRT User


Joined: 07 Jun 2006
Posts: 181
Location: BULGARIA

PostPosted: Wed Jun 21, 2006 13:10    Post subject: Reply with quote
I have a question.

Can I shedule router shutdown and then wake up ?
Example:

Shutdown at everyday on 00:00 and wake up in 7:00 AM ? Or stop wireless transmission on 00:00 and turn it on on 7:00. No wireless transmission from 00:00 to 7:00 AM.

Is that possible?
2.3SP1 Rolling Eyes
beat
DD-WRT Novice


Joined: 18 Jun 2006
Posts: 11

PostPosted: Wed Jun 21, 2006 13:37    Post subject: Reply with quote
well i read the wiki but i didnt get it, could some cron expert help me? Embarassed
wlan
DD-WRT User


Joined: 07 Jun 2006
Posts: 181
Location: BULGARIA

PostPosted: Wed Jun 21, 2006 13:53    Post subject: Reply with quote
AZImmortal wrote:
I don't think this is possible. If your goal is to disallow internet access, you can try using the Access Restrictions.


No, I want to shedule wireless access to the AP, and stop completely wireless transmission between 00:00 and 7:00. I don't use router to route the Internet, I used it only for wireless access.

So, any ideas ? Rolling Eyes
BigL
DD-WRT User


Joined: 07 Jun 2006
Posts: 79

PostPosted: Wed Jun 21, 2006 14:08    Post subject: Reply with quote
Use cron scripts - first to disable WiFi interface (using ifconfig) and then to enable it again.
sputy
DD-WRT Novice


Joined: 08 Jun 2006
Posts: 36

PostPosted: Wed Jun 21, 2006 17:01    Post subject: Reply with quote
Hi,

You are echoing to the readonly filesystem.

Instead do

Code:
echo "10 1 * * * root /sbin/reboot" >> /tmp/crontab
echo "50 7 * * * root /sbin/reboot" >> /tmp/crontab


note the >> which means add to, not overwrite, if you dont then
other existing stuff in the crontab file will be blitzed.

to put the radio up or down substitute the reboot command with

Code:
/usr/sbin/wl up
/usr/sbin/wl down
beat
DD-WRT Novice


Joined: 18 Jun 2006
Posts: 11

PostPosted: Wed Jun 21, 2006 19:13    Post subject: Reply with quote
thanks a lot ;D

note: it didnt work Sad
wlan
DD-WRT User


Joined: 07 Jun 2006
Posts: 181
Location: BULGARIA

PostPosted: Wed Jun 21, 2006 20:02    Post subject: Reply with quote
sputy what exactly I must enter?

echo '# minute 0 hour 0 day of the month 1 (how is for everyday?) /usr/sbin/wl down' >> /tmp/crontab

echo '# minute 0 hour 7 day of the month 1 /usr/sbin/wl up' >> /tmp/crontab

? Rolling Eyes Please help.
HWS
DD-WRT Guru


Joined: 06 Jun 2006
Posts: 579
Location: Germany

PostPosted: Wed Jun 21, 2006 20:06    Post subject: Reply with quote
Here is a working script for wlan & cron
_________________
DD-WRT v23 SP2 (09/13/06) std on WRT54GL V1.1
Last News
beat
DD-WRT Novice


Joined: 18 Jun 2006
Posts: 11

PostPosted: Wed Jun 21, 2006 23:53    Post subject: Reply with quote
what about me Crying or Very sad
wlan
DD-WRT User


Joined: 07 Jun 2006
Posts: 181
Location: BULGARIA

PostPosted: Thu Jun 22, 2006 6:13    Post subject: Reply with quote
Quote:
//** ------ Reboot script ' daily ------ **//
Example: Reboot your router at 01:10h and 07:50h
Code:
echo '10 01 * * * root /sbin/reboot' > /tmp/cron.d/myreboot
echo '50 07 * * * root /sbin/reboot' >> /tmp/cron.d/myreboot
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum