Event to stop/start Zoneminder
Posted: Tuesday 21 August 2018 20:46
I have Domoticz with Security Panel configured on an Ubuntu 16.04 LTS server. The same server runs Zoneminder to record events for several camera's when it detects motion. My Zoneminder events just get filled up with videos when I am home, so no need to have Zoneminder running while I am home. So I was thinking to stop the Zoneminder service whenever the security state in Domoticz is disarmed.
I created a simple 'service zoneminder stop' bash script that stops the Zoneminder service. For testing purposes I set the script permissions to 777, it works when I run it in a terminal as either the 'domoticz' user or 'root'. But when I create a simple Blockly event that runs the script when I switch on a dummy switch, I get an error in the log:
Error executing script command (/home/domoticz/scripts/stop_zoneminder.sh). returned: 256
I get the feeling there should me a more elegant way to do this, but this is the only way I could think of. Anyone?
I created a simple 'service zoneminder stop' bash script that stops the Zoneminder service. For testing purposes I set the script permissions to 777, it works when I run it in a terminal as either the 'domoticz' user or 'root'. But when I create a simple Blockly event that runs the script when I switch on a dummy switch, I get an error in the log:
Error executing script command (/home/domoticz/scripts/stop_zoneminder.sh). returned: 256
I get the feeling there should me a more elegant way to do this, but this is the only way I could think of. Anyone?