summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts/services/zoneminder/run
blob: 050f5118ecfc49e2c6867b0f71acf05ab6e5de94 (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
/usr/bin/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