# This number should be more than enough (even if it is
# started multiple times together). It will try for up
# to 10 attempts (or 10 seconds) to execute.
MAX_ITERATION="10"
# This number should be more than enough (even if it is
# started multiple times together). It will try for up
# to 10 attempts (or 10 seconds) to execute.
MAX_ITERATION="10"
if [ "X$2" = "Xdatabase" ]; then
echo "DB_DAEMON=ossec-dbd" >> ${PLIST};
elif [ "X$2" = "Xclient-syslog" ]; then
echo "CSYSLOG_DAEMON=ossec-csyslogd" >> ${PLIST};
elif [ "X$2" = "Xagentless" ]; then
if [ "X$2" = "Xdatabase" ]; then
echo "DB_DAEMON=ossec-dbd" >> ${PLIST};
elif [ "X$2" = "Xclient-syslog" ]; then
echo "CSYSLOG_DAEMON=ossec-csyslogd" >> ${PLIST};
elif [ "X$2" = "Xagentless" ]; then
- echo "AGENTLESS_DAEMON=ossec-agentlessd" >> ${PLIST};
- elif [ "X$2" = "Xdebug" ]; then
- echo "DEBUG_CLI=\"-d\"" >> ${PLIST};
+ echo "AGENTLESS_DAEMON=ossec-agentlessd" >> ${PLIST};
+ elif [ "X$2" = "Xdebug" ]; then
+ echo "DEBUG_CLI=\"-d\"" >> ${PLIST};
echo "Enable options: database, client-syslog, agentless, debug"
echo "Usage: $0 enable [database|client-syslog|agentless|debug]"
exit 1;
echo "Enable options: database, client-syslog, agentless, debug"
echo "Usage: $0 enable [database|client-syslog|agentless|debug]"
exit 1;
if [ "X$2" = "Xdatabase" ]; then
echo "DB_DAEMON=\"\"" >> ${PLIST};
elif [ "X$2" = "Xclient-syslog" ]; then
echo "CSYSLOG_DAEMON=\"\"" >> ${PLIST};
elif [ "X$2" = "Xagentless" ]; then
if [ "X$2" = "Xdatabase" ]; then
echo "DB_DAEMON=\"\"" >> ${PLIST};
elif [ "X$2" = "Xclient-syslog" ]; then
echo "CSYSLOG_DAEMON=\"\"" >> ${PLIST};
elif [ "X$2" = "Xagentless" ]; then
- echo "AGENTLESS_DAEMON=\"\"" >> ${PLIST};
- elif [ "X$2" = "Xdebug" ]; then
- echo "DEBUG_CLI=\"\"" >> ${PLIST};
+ echo "AGENTLESS_DAEMON=\"\"" >> ${PLIST};
+ elif [ "X$2" = "Xdebug" ]; then
+ echo "DEBUG_CLI=\"\"" >> ${PLIST};
echo "Disable options: database, client-syslog, agentless, debug"
echo "Usage: $0 disable [database|client-syslog|agentless|debug]"
exit 1;
echo "Disable options: database, client-syslog, agentless, debug"
echo "Usage: $0 disable [database|client-syslog|agentless|debug]"
exit 1;
echo | ${DIR}/bin/ossec-logtest > /dev/null 2>&1;
if [ ! $? = 0 ]; then
echo "OSSEC analysisd: Testing rules failed. Configuration error. Exiting."
exit 1;
echo | ${DIR}/bin/ossec-logtest > /dev/null 2>&1;
if [ ! $? = 0 ]; then
echo "OSSEC analysisd: Testing rules failed. Configuration error. Exiting."
exit 1;
ls ${DIR}/var/run/${pfile}*.pid > /dev/null 2>&1
if [ $? = 0 ]; then
for j in `cat ${DIR}/var/run/${pfile}*.pid 2>/dev/null`; do
ls ${DIR}/var/run/${pfile}*.pid > /dev/null 2>&1
if [ $? = 0 ]; then
for j in `cat ${DIR}/var/run/${pfile}*.pid 2>/dev/null`; do