3 # by gentuxx <gentuxx@gmail.com>
6 opts="${opts} status configtest"
8 # Finding where ossec is installed
10 if [ "X${DIRECTORY}" = "X" ]; then
11 DIRECTORY="/var/ossec"
14 OSSEC_CONTROL="${DIRECTORY}/bin/ossec-control"
22 ebegin "Checking OSSEC Configuration"
29 CONFIGFILE="${CONFIGFILE:-/var/ossec/etc/ossec.conf}"
30 if [ ! -r "${CONFIGFILE}" ]; then
31 eerror "Unable to read configuration file: ${CONFIGFILE}"
35 # Maybe put some kind of config file syntax checking in here? XML is a little different
41 checkconfig || return 1
42 ebegin "Starting ossec-hids"
43 ${OSSEC_CONTROL} start > /dev/null 2>&1
48 checkconfig || return 1
49 ebegin "Stopping ossec-hids"
50 ${OSSEC_CONTROL} stop > /dev/null 2>&1
55 if ! service_started "${myservice}" ; then
56 eerror "OSSEC is not running! Please start it before trying to reload it."
58 checkconfig || return 1
59 ebegin "Reloading ossec"
60 svc_stop ${OSSEC_CONTROL}
61 svc_start ${OSSEC_CONTROL}
67 checkconfig || return 1
68 ${OSSEC_CONTROL} status