LinuxMCE Forums

General => Users => Topic started by: purps on December 02, 2010, 11:15:53 PM

Title: Quick/force reload router -> run a script
Post by: purps on December 02, 2010, 11:15:53 PM
Is it possible to make a script run when the router is reloaded?

Cheers,
Matt
Title: Re: Quick/force reload router -> run a script
Post by: tschak909 on December 03, 2010, 02:59:35 PM
What are you wanting to do?

-Thom
Title: Re: Quick/force reload router -> run a script
Post by: purps on December 03, 2010, 03:46:02 PM
I was intending on writing a little script to carry out a "/etc/init.d/motion restart" command, as I have read that this needs to be done after every router reload. For example...


#!/bin/bash
sleep 30 && /etc/init.d/motion restart


I assume root privileges are needed, but obviously I would like to do it without typing in a password, so perhaps this is not the best way to do it. Now that I think about it, maybe this could be achieved more easily by placing "/etc/init.d/motion restart" into a pre-exiting file somewhere?

Cheers,
Matt.
Title: Re: Quick/force reload router -> run a script
Post by: tschak909 on December 03, 2010, 03:59:53 PM
Looks like the Motion DCE device needs to be fixed, instead of trying to fire a script each time.

Can someone step up and do this?

Can you please file a bug at least so this can be properly fixed?

-Thom
Title: Re: Quick/force reload router -> run a script
Post by: purps on December 03, 2010, 05:02:56 PM
I get the message "500 Internal Server Error (Submission rejected as potential spam (SpamBayes determined spam probability of 94.30%))" when I try to submit a ticket! What am I doing wrong?
Title: Re: Quick/force reload router -> run a script
Post by: jondecker76 on December 03, 2010, 07:17:24 PM
I did the bug report:
http://svn.linuxmce.org/trac.cgi/ticket/904 (http://svn.linuxmce.org/trac.cgi/ticket/904)

I will also be fixing it. I'll report back here in a few days after I get a chance to work on it.
Title: Re: Quick/force reload router -> run a script
Post by: DragonK on December 04, 2010, 07:58:41 AM
Hi Guys,

Sorry to "butt in", but isnt this the same ticket???

http://svn.linuxmce.org/trac.cgi/ticket/715

Karel
Title: Re: Quick/force reload router -> run a script
Post by: jondecker76 on December 04, 2010, 01:06:30 PM
Ticket 715 seems to be different - Motion continues to run, but the camera locks up until the camera its self is reset.

Perhaps just to be sure, Purps could also try this and report back:
Reload the router. When Motion stops working, reset the camera by unplugging it and plugging it back in. If it comes back to life, the 2 bugs could be related.
Title: Re: Quick/force reload router -> run a script
Post by: purps on December 04, 2010, 01:13:42 PM
I have two different types of camera; the Panasonic BL-C10 and the outdoor-type Foscam. I have found that motion does need to be restarted after a router reload. From then on, the Panasonics are fine, but the Foscams stop working after a while, requiring the cameras to be powered down and switched back on before they work again. Could this be the DHCP problem though?
Title: Re: Quick/force reload router -> run a script
Post by: jondecker76 on December 04, 2010, 02:26:54 PM
I know a few people with foscam cameras and they all suffer from random dropouts - i think thats a foscam issue
Title: Re: Quick/force reload router -> run a script
Post by: b4rney on December 04, 2010, 02:58:38 PM
I can confirm this.

Sometimes my wired foscam loses dhcp completely and cannot be reached. Either rebooting the camera or simply removing and replacing the ethernet cable works (for a while).

This issue will not be resolved by a motion restart/fix.

FYI if connected to the external network (router with dhcp) this does not occur so it could be a lmce dhcp problem.

Barney
Title: Re: Quick/force reload router -> run a script
Post by: b4rney on December 04, 2010, 03:06:38 PM
Just googled this:
http://blog.stead.id.au/2010/06/resolving-foscam-connection-dropouts.html

Barney

Continuing this topic here:
http://forum.linuxmce.org/index.php?topic=10134.0