Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/sh
2
# OSSEC	        Controls OSSEC HIDS on Redhat-based systems
3
# Author:       Kayvan A. Sylvan <kayvan@sylvan.com>
4
# Author:       Daniel B. Cid <dcid@ossec.net>
5
#
6
# chkconfig: 2345 99 15
7
# description: Starts and stops OSSEC HIDS (Host Intrusion Detection System)
8
#
9
# This will work on Redhat systems (maybe others too)
10
 
11
# Source function library.
12
export LANG=C
13
 
14
. /etc/init.d/functions
15
. /etc/ossec-init.conf
16
 
17
if [ "X${DIRECTORY}" = "X" ]; then
18
    DIRECTORY="/var/ossec"
19
fi
20
 
21
start() {
22
	echo -n "Starting OSSEC: "
23
	${DIRECTORY}/bin/ossec-control start > /dev/null
24
	RETVAL=$?
25
	if [ $RETVAL -eq 0 ]; then
26
		success
27
	else
28
		failure
29
	fi
30
	echo
31
	return $RETVAL
32
}
33
 
34
stop() {
35
	echo -n "Stopping OSSEC: "
36
	${DIRECTORY}/bin/ossec-control stop > /dev/null
37
	RETVAL=$?
38
	if [ $RETVAL -eq 0 ]; then
39
		success
40
	else
41
		failure
42
	fi
43
	echo
44
	return $RETVAL
45
}
46
 
47
status() {
48
	${DIRECTORY}/bin/ossec-control status
49
}
50
 
51
 
52
case "$1" in
53
  start)
54
	start
55
	;;
56
  stop)
57
	stop
58
	;;
59
  restart)
60
	stop
61
	start
62
	;;
63
  status)
64
    status
65
	;;
66
  *)
67
	echo "*** Usage: ossec {start|stop|restart|status}"
68
	exit 1
69
esac
70
 
71
exit $?