Imported Upstream version 2.7
[ossec-hids.git] / src / init / ossec-hids-debian.init
1 #!/bin/sh
2 # OSSEC         Controls OSSEC HIDS
3 # Author:       Daniel B. Cid <dcid@ossec.net>
4 # Modified for Debian by Michael Starks (patch by Costas Drogos)
5
6 ### BEGIN INIT INFO
7 # Provides:          ossec
8 # Required-Start:    $remote_fs $syslog
9 # Required-Stop:     $remote_fs $syslog
10 # Should-Start:      $network 
11 # Should-Stop:       $network
12 # Default-Start:     2 3 4 5
13 # Default-Stop:      0 1 6
14 # Short-Description: Start and stop OSSEC HIDS
15 # Description:       Controls OSSEC HIDS daemons
16 #
17 ### END INIT INFO
18
19 . /etc/ossec-init.conf
20 if [ "X${DIRECTORY}" = "X" ]; then
21     DIRECTORY="/var/ossec"
22 fi
23
24     
25 start() {
26         ${DIRECTORY}/bin/ossec-control start
27 }
28
29 stop() {
30         ${DIRECTORY}/bin/ossec-control stop
31 }
32
33 status() {
34         ${DIRECTORY}/bin/ossec-control status
35 }
36
37
38 case "$1" in
39   start)
40         start
41         ;;
42   stop) 
43         stop
44         ;;
45   restart)
46         stop
47         start
48         ;;
49   status)
50     status
51         ;;
52   *)
53         echo "*** Usage: $0 {start|stop|restart|status}"
54         exit 1
55 esac
56
57 exit 0