summaryrefslogtreecommitdiff
path: root/pcr/zoneminder-lts/zoneminder
blob: c4cbf4d3f259016d790c041e8227645110053c2d (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash

daemon_name=zm

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
  start)
    stat_busy "Starting Zoneminder"
    /usr/bin/zmfix -a
    if /usr/bin/zmpkg.pl start >/dev/null ; then
      add_daemon $daemon_name
      stat_done
    else
      stat_fail
      exit 1
    fi
    ;;

  stop)
    stat_busy "Stopping Zoneminder"
    if /usr/bin/zmpkg.pl stop >/dev/null ; then
      rm_daemon $daemon_name
      stat_done
    else
      stat_fail
      exit 1
    fi
    ;;

  reload)
    stat_busy "Reloading Zoneminder"
    if /usr/bin/zmpkg.pl graceful >/dev/null ; then
      add_daemon $daemon_name
      stat_done
    else
      stat_fail
      exit 1
    fi
    ;;

  restart)
    stat_busy "Restarting Zoneminder"
    if /usr/bin/zmpkg.pl restart >/dev/null ; then
      add_daemon $daemon_name
      stat_done
    else
      stat_fail
      exit 1
    fi
    ;;

  status)
    stat_busy "Checking Zoneminder status";
    ck_status $daemon_name
    ;;

  *)
    echo "usage: $0 {start|stop|reload|restart|status}"
esac

exit 0