# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
-#
+#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
if [ -f /etc/ossec-init.conf ]; then
. /etc/ossec-init.conf
fi
-
+
if [ "X${DIRECTORY}" = "X" ]; then
DIRECTORY="/var/ossec"
fi
#Just to make sure ossec is installed ...
CONTROL="$DIRECTORY/bin/ossec-control"
-test -x $CONTROL || { echo "$CONTROL not installed";
+test -x $CONTROL || { echo "$CONTROL not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
-
-
+
start() {
- ${DIRECTORY}/bin/ossec-control start
+ ${DIRECTORY}/bin/ossec-control start
}
stop() {
- ${DIRECTORY}/bin/ossec-control stop
+ ${DIRECTORY}/bin/ossec-control stop
}
status() {
- ${DIRECTORY}/bin/ossec-control status
+ ${DIRECTORY}/bin/ossec-control status
}
-
case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- start
- ;;
- status)
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+restart)
+ stop
+ start
+ ;;
+status)
status
- ;;
- *)
- echo "*** Usage: $0 {start|stop|restart|status}"
- exit 1
+ ;;
+*)
+ echo "*** Usage: $0 {start|stop|restart|status}"
+ exit 1
esac
exit 0