3 # by gentuxx <gentuxx@gmail.com>
5 opts="${opts} status configtest"
7 # Finding where ossec is installed
9 if [ "X${DIRECTORY}" = "X" ]; then
10 DIRECTORY="/var/ossec"
13 OSSEC_CONTROL="${DIRECTORY}/bin/ossec-control"
21 ebegin "Checking OSSEC Configuration"
27 CONFIGFILE="${CONFIGFILE:-${DIRECTORY}/etc/ossec.conf}"
28 if [ ! -r "${CONFIGFILE}" ]; then
29 eerror "Unable to read configuration file: ${CONFIGFILE}"
33 # Maybe put some kind of config file syntax checking in here? XML is a little different
39 checkconfig || return 1
40 ebegin "Starting ossec-hids"
41 ${OSSEC_CONTROL} start > /dev/null 2>&1
46 checkconfig || return 1
47 ebegin "Stopping ossec-hids"
48 ${OSSEC_CONTROL} stop > /dev/null 2>&1
53 if ! service_started "${myservice}" ; then
54 eerror "OSSEC is not running! Please start it before trying to reload it."
56 checkconfig || return 1
57 ebegin "Reloading ossec"
58 svc_stop ${OSSEC_CONTROL}
59 svc_start ${OSSEC_CONTROL}
65 checkconfig || return 1
66 ${OSSEC_CONTROL} status