Don't sleep if not registering agent

This commit is contained in:
weslambert
2020-11-05 14:03:08 -05:00
committed by GitHub
parent 4fed5c2518
commit 2911e37b70

View File

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