projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dodan override za lintian
[ossec-hids.git]
/
src
/
init
/
ossec-client.sh
diff --git
a/src/init/ossec-client.sh
b/src/init/ossec-client.sh
index
e05d615
..
f1650f0
100755
(executable)
--- a/
src/init/ossec-client.sh
+++ b/
src/init/ossec-client.sh
@@
-11,7
+11,7
@@
DIR=`dirname $PWD`;
### Do not modify bellow here ###
NAME="OSSEC HIDS"
### Do not modify bellow here ###
NAME="OSSEC HIDS"
-VERSION="v2.3"
+VERSION="v2.8.3"
AUTHOR="Trend Micro Inc."
DAEMONS="ossec-logcollector ossec-syscheckd ossec-agentd ossec-execd"
AUTHOR="Trend Micro Inc."
DAEMONS="ossec-logcollector ossec-syscheckd ossec-agentd ossec-execd"
@@
-101,26
+101,21
@@
help()
# Status function
status()
{
# Status function
status()
{
+ RETVAL=0
for i in ${DAEMONS}; do
pstatus ${i};
if [ $? = 0 ]; then
for i in ${DAEMONS}; do
pstatus ${i};
if [ $? = 0 ]; then
+ RETVAL=1
echo "${i} not running..."
else
echo "${i} is running..."
fi
done
echo "${i} not running..."
else
echo "${i} is running..."
fi
done
+ exit $RETVAL
}
}
-
-# Start function
-start()
+testconfig()
{
{
- SDAEMONS="ossec-execd ossec-agentd ossec-logcollector ossec-syscheckd"
-
- echo "Starting $NAME $VERSION (by $AUTHOR)..."
- lock;
- checkpid;
-
# We first loop to check the config.
for i in ${SDAEMONS}; do
${DIR}/bin/${i} -t;
# We first loop to check the config.
for i in ${SDAEMONS}; do
${DIR}/bin/${i} -t;
@@
-130,6
+125,17
@@
start()
exit 1;
fi
done
exit 1;
fi
done
+}
+
+# Start function
+start()
+{
+ SDAEMONS="ossec-execd ossec-agentd ossec-logcollector ossec-syscheckd"
+
+ echo "Starting $NAME $VERSION (by $AUTHOR)..."
+ lock;
+ checkpid;
+
# We actually start them now.
for i in ${SDAEMONS}; do
# We actually start them now.
for i in ${SDAEMONS}; do
@@
-137,6
+143,7
@@
start()
if [ $? = 0 ]; then
${DIR}/bin/${i};
if [ $? != 0 ]; then
if [ $? = 0 ]; then
${DIR}/bin/${i};
if [ $? != 0 ]; then
+ echo "${i} did not start";
unlock;
exit 1;
fi
unlock;
exit 1;
fi
@@
-214,12
+221,20
@@
stopa()
case "$1" in
start)
case "$1" in
start)
+ testconfig
start
;;
stop)
stopa
;;
restart)
start
;;
stop)
stopa
;;
restart)
+ testconfig
+ stopa
+ sleep 1;
+ start
+ ;;
+ reload)
+ DAEMONS="ossec-logcollector ossec-syscheckd ossec-agentd"
stopa
start
;;
stopa
start
;;
@@
-232,3
+247,4
@@
case "$1" in
*)
help
esac
*)
help
esac
+