Author Topic: Quick/force reload router -> run a script  (Read 6134 times)

purps

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1402
  • If it ain't broke, tweak it
    • View Profile
Quick/force reload router -> run a script
« on: December 02, 2010, 11:15:53 pm »
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 :: http://wiki.linuxmce.org/index.php/User:Purps

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Quick/force reload router -> run a script
« Reply #1 on: December 03, 2010, 02:59:35 pm »
What are you wanting to do?

-Thom

purps

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1402
  • If it ain't broke, tweak it
    • View Profile
Re: Quick/force reload router -> run a script
« Reply #2 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...

Code: [Select]
#!/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 :: http://wiki.linuxmce.org/index.php/User:Purps

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Quick/force reload router -> run a script
« Reply #3 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

purps

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1402
  • If it ain't broke, tweak it
    • View Profile
Re: Quick/force reload router -> run a script
« Reply #4 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?
1004 RC :: looking good :: upgraded 01/04/2013
my setup :: http://wiki.linuxmce.org/index.php/User:Purps

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: Quick/force reload router -> run a script
« Reply #5 on: December 03, 2010, 07:17:24 pm »
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

  • Guru
  • ****
  • Posts: 446
    • View Profile
Re: Quick/force reload router -> run a script
« Reply #6 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

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: Quick/force reload router -> run a script
« Reply #7 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.

purps

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1402
  • If it ain't broke, tweak it
    • View Profile
Re: Quick/force reload router -> run a script
« Reply #8 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?
« Last Edit: December 04, 2010, 01:16:02 pm by purps »
1004 RC :: looking good :: upgraded 01/04/2013
my setup :: http://wiki.linuxmce.org/index.php/User:Purps

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: Quick/force reload router -> run a script
« Reply #9 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

b4rney

  • Guru
  • ****
  • Posts: 454
    • View Profile
Re: Quick/force reload router -> run a script
« Reply #10 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

b4rney

  • Guru
  • ****
  • Posts: 454
    • View Profile
« Last Edit: December 04, 2010, 06:13:53 pm by b4rney »