summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts/services/zoneminder/run
blob: dfd15f30073475fac1b0869abfc6491c5d54bdf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
exec 2>&1

export TERM=linux
MYTH_RUN_STATUS="1"
. /etc/rc.conf
. /etc/rc.d/functions
#wait for mysql
/sbin/svwaitup -s 20 /service/mysql

stat_runit "Starting ZoneMinder"
/usr/bin/zmpkg.pl start  2>/tmp/zoneminder.out
rc=$?
if [ $rc = 0 ]
then
   PID=`pidof -x zmdc.pl`
   while [[ -d /proc/$PID ]]
   do
      sleep 45
   done
else
  stat_runit "Zoneminder did not start correctly"
fi