summaryrefslogtreecommitdiffstats
path: root/abs/core/zoneminder/run
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/zoneminder/run')
-rwxr-xr-xabs/core/zoneminder/run19
1 files changed, 17 insertions, 2 deletions
diff --git a/abs/core/zoneminder/run b/abs/core/zoneminder/run
index e458bc8..ce61c24 100755
--- a/abs/core/zoneminder/run
+++ b/abs/core/zoneminder/run
@@ -2,5 +2,20 @@
export TERM=linux
. /etc/rc.conf
. /etc/rc.d/functions
-stat_runit "Starting ZoneMinder"
-exec /etc/rc.d/zm start
+
+while true ; do
+ PID=`pidof -x zmdc.pl`
+ if test -n "$PID" ; then
+ sleep 60
+ continue
+ fi
+ stat_runit "Starting ZoneMinder"
+ /etc/rc.d/zm start
+ if test $? -ne 0 ; then
+ stat_fail
+ else
+ add_daemon zm
+ stat_done
+ fi
+ sleep 30
+done