novi upstream verzije 2.8.3
[ossec-hids.git] / src / init / ossec-client.sh
index f8d6159..f1650f0 100755 (executable)
@@ -11,7 +11,7 @@ DIR=`dirname $PWD`;
 
 ###  Do not modify bellow here ###
 NAME="OSSEC HIDS"
-VERSION="v2.5.1"
+VERSION="v2.8.3"
 AUTHOR="Trend Micro Inc."
 DAEMONS="ossec-logcollector ossec-syscheckd ossec-agentd ossec-execd"
 
@@ -101,14 +101,17 @@ help()
 # Status function
 status()
 {
+    RETVAL=0
     for i in ${DAEMONS}; do
         pstatus ${i};
         if [ $? = 0 ]; then
+            RETVAL=1
             echo "${i} not running..."
         else
             echo "${i} is running..."
         fi
     done             
+    exit $RETVAL
 }
 
 testconfig()
@@ -140,6 +143,7 @@ start()
         if [ $? = 0 ]; then
             ${DIR}/bin/${i};
             if [ $? != 0 ]; then
+               echo "${i} did not start";
                 unlock;
                 exit 1;
             fi 
@@ -226,6 +230,12 @@ case "$1" in
   restart)
     testconfig
        stopa
+        sleep 1;
+       start
+       ;;
+  reload)
+       DAEMONS="ossec-logcollector ossec-syscheckd ossec-agentd"
+       stopa
        start
        ;;
   status)
@@ -237,3 +247,4 @@ case "$1" in
   *)
     help
 esac
+