News:

Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com

Main Menu

Quick/force reload router -> run a script

Started by purps, December 02, 2010, 11:15:53 PM

Previous topic - Next topic

purps

Is it possible to make a script run when the router is reloaded?

Cheers,
Matt
1004 RC :: looking good :: upgraded 01/04/2013
my setup :: [url="http://wiki.linuxmce.org/index.php/User:Purps"]http://wiki.linuxmce.org/index.php/User:Purps[/url]

tschak909


purps

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.
1004 RC :: looking good :: upgraded 01/04/2013
my setup :: [url="http://wiki.linuxmce.org/index.php/User:Purps"]http://wiki.linuxmce.org/index.php/User:Purps[/url]

tschak909

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

purps

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?
1004 RC :: looking good :: upgraded 01/04/2013
my setup :: [url="http://wiki.linuxmce.org/index.php/User:Purps"]http://wiki.linuxmce.org/index.php/User:Purps[/url]

jondecker76

I did the bug report:
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.

DragonK


jondecker76

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.

purps

#8
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?
1004 RC :: looking good :: upgraded 01/04/2013
my setup :: [url="http://wiki.linuxmce.org/index.php/User:Purps"]http://wiki.linuxmce.org/index.php/User:Purps[/url]

jondecker76

I know a few people with foscam cameras and they all suffer from random dropouts - i think thats a foscam issue

b4rney

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