#!/bin/bash # OSSEC Controls OSSEC HIDS # Author: Daniel B. Cid # Modified for slackware by Jack S. Lai . /etc/ossec-init.conf if [ "X${DIRECTORY}" = "X" ]; then DIRECTORY="/var/ossec" fi start() { echo -n "Starting OSSEC-HIDS " ${DIRECTORY}/bin/ossec-control start > /dev/null if [ $? -gt 0 ]; then echo "failed." else echo "done." fi } stop() { echo -n "Stopping OSSEC-HIDS " ${DIRECTORY}/bin/ossec-control stop > /dev/null if [ $? -gt 0 ]; then echo "failed." else echo "done." fi } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) ${DIRECTORY}/bin/ossec-control status ;; *) echo "*** Usage: $0 {start|stop|restart|status}" exit 1 esac