1#!/bin/bash 2# OSSEC Controls OSSEC HIDS on Solaris 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 Solaris systems (maybe others too) 10# 11# Modified by Chris Cuevas and Darryl Marsee to work on Solaris 12# 13# Source function library. 14LANG=C 15export $LANG 16 17. /etc/ossec-init.conf 18 19if [ "X${DIRECTORY}" = "X" ]; then 20 DIRECTORY="/var/ossec" 21fi 22 23start() { 24 echo -n "Starting OSSEC: " 25 ${DIRECTORY}/bin/ossec-control start > /dev/null 26 RETVAL=$? 27 if [ $RETVAL -eq 0 ]; then 28 echo success 29 else 30 echo failure 31 fi 32 echo 33 return $RETVAL 34} 35 36stop() { 37 echo -n "Stopping OSSEC: " 38 ${DIRECTORY}/bin/ossec-control stop > /dev/null 39 RETVAL=$? 40 if [ $RETVAL -eq 0 ]; then 41 echo success 42 else 43 echo failure 44 fi 45 echo 46 return $RETVAL 47} 48 49status() { 50 ${DIRECTORY}/bin/ossec-control status 51} 52 53 54case "$1" in 55 start) 56 start 57 ;; 58 stop) 59 stop 60 ;; 61 restart) 62 stop 63 start 64 ;; 65 status) 66 status 67 ;; 68 *) 69 echo "*** Usage: ossec {start|stop|restart|status}" 70 exit 1 71esac 72 73exit $? 74