Merge pull request #1836 from Security-Onion-Solutions/fix/wazuh_agent_register

Don't sleep if not registering agent
This commit is contained in:
weslambert
2020-11-05 14:03:32 -05:00
committed by GitHub

View File

@@ -136,13 +136,12 @@ shift $(($OPTIND - 1))
# fi
# fi
# Default action -> try to register the agent
echo "Waiting before registering agent..."
sleep 30s
if [ -f /opt/so/conf/wazuh/initial_agent_registration.log ]; then
echo "Agent $AGENT_ID already registered!"
exit 0
else
echo "Waiting before registering agent..."
sleep 30s
register_agent
cleanup_creds
echo "Initial agent $AGENT_ID with IP $AGENT_IP registered on $DATE." > /opt/so/conf/wazuh/initial_agent_registration.log