Deprecated: Function set_magic_quotes_runtime() is deprecated in /membri/cyberstorm/phpBB3/common.php on line 106

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /membri/cyberstorm/phpBB3/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3390: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3392: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3393: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3394: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
Neptune354 • View topic - Option to periodically restart WAN connection




Neptune354


SORRY GUYS; DUE TO A BIG AMOUNT OF SPAM I HAVE BLOCKED ALL THE FORUM ACTIVITY :-/
It is currently 22 Apr 2018, 14:00

All times are UTC + 1 hour [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: Option to periodically restart WAN connection
PostPosted: 08 Jun 2007, 14:58 
Offline
 Profile

Joined: 07 Jun 2007, 22:06
Posts: 31
My provider disconnects my connection every 24h of uptime.

Would it be possible to have an option to do this manually on some choosed time? Like a cron job but as I understand, router does not have cron.

It would be nice because I could set it to disconnect like at 5 in the morning and wouldn't have to worry that it will disconnect in the middle of a game or some other important thing.


Top
 

 Post subject: Re: Option to periodically restart WAN connection
PostPosted: 08 Jun 2007, 17:01 
Offline
Site Admin
 Profile

Joined: 04 Jun 2007, 17:55
Posts: 67
The firmware has cron.I think that for your goal all you need to do is put in /mnt/script.sh this:

Code:
#! /bin/sh
echo "00 05 * * * killall pppd" > /tmp/cron.d/restart_wan


After creating the file script.sh, remember to umount /mnt/, otherwise changes are not saved.
Test it (maybe with another hour :) ) and tell me if it works.


Top
 

 Post subject: Re: Option to periodically restart WAN connection
PostPosted: 11 Jun 2007, 10:59 
Offline
 Profile

Joined: 07 Jun 2007, 22:06
Posts: 31
cyberstorm wrote:
After creating the file script.sh, remember to umount /mnt/, otherwise changes are not saved.
Test it (maybe with another hour :) ) and tell me if it works.

Thanks a lot. Will try it as soon as I get additional partition to mount.

Do you know if Carciofone is working on a fix for mount problem?


Top
 

 Post subject: Re: Option to periodically restart WAN connection
PostPosted: 11 Jun 2007, 15:10 
Offline
 Profile

Joined: 07 Jun 2007, 22:06
Posts: 31
I haven't noticed that there was already fixed version when I've posted this. Thanks Carciofone. :)

I've tried your method and it does not quite wants to work.
Added restart_wan (not sure if it's needed but I've also set 'x' permission to it) to /tmp/cron.d/ with that content:
Code:
00 15 * * * killall pppd

and connection is still happily working at 15:01
Code:
Current Time:    Mon 11 , Jun 2007 15:01:18
Connection uptime:   0 Days, 2 Hours, 13 Minutes, 1 Second


Top
 

 Post subject: Re: Option to periodically restart WAN connection
PostPosted: 11 Jun 2007, 17:37 
Offline
 Profile

Joined: 07 Jun 2007, 22:06
Posts: 31
I think I got it working.

First, I had to add user name in cron line:
Code:
00 15 * * * root killall pppd


Second, I had to killall cron process and start it again because it seems it's not picking up new or modified jobs by itself.

I can do this in startup script. Is killing the best way to do this?


Top
 

 Post subject: Re: Option to periodically restart WAN connection
PostPosted: 11 Jun 2007, 20:34 
Offline
Site Admin
 Profile

Joined: 04 Jun 2007, 17:55
Posts: 67
you have to restart cron only if it is already running when you add a job.
Unluckily startup script is run after the start of cron, so you need to restart it. Or maybe try a "killall -HUP cron" to see if new jobs are read. If not you just need to put this 2 lines in script.sh:
Code:
killall cron
cron


There is not an easy way to change the order of application start, the only way is modify the source code.

Sorry I forgot about adding "root" to crontab.


Top
 

 Post subject: Re: Option to periodically restart WAN connection
PostPosted: 11 Jun 2007, 21:58 
Offline
 Profile

Joined: 07 Jun 2007, 22:06
Posts: 31
Yep, I did killall cron.
But I had to specify full path /usr/sbin/cron


Top
 

 Post subject: Re: Option to periodically restart WAN connection
PostPosted: 04 Oct 2007, 16:00 
Offline
 Profile

Joined: 04 Oct 2007, 15:47
Posts: 1
Hi,

I wonder if there is a way to know if the connection is still alive or not, because my wan connection drops down some time without reason.
I will use this in a cron job to check every 30 min if the wan is still alive.

TIA, _MOI_

Edit :
It's ok, I test it with the result status of a ping


Top
 

Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC + 1 hour [ DST ]



Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group  
Design By Poker Bandits