Skip to content
Snippets Groups Projects
Commit c803730f authored by Vinicius Ruoso's avatar Vinicius Ruoso Committed by Josiney de Souza
Browse files

Added check on inep file when generating the run minute to cron


If the inep file is missing, we calculate the cron run minute based on a
random number. This will allow the agent.sh to run correctly even when
there's no inep stored on the system.

Signed-off-by: default avatarVinicius Ruoso <vkr07@c3sl.ufpr.br>
Acked-by: default avatarDiego Pasqualin <dgp06@c3sl.ufpr.br>
Acked-by: default avatarErik Alexandre Pucci <eap08@c3sl.ufpr.br>
Acked-by: default avatarRicardo T Oliveira <rto07@c3sl.ufpr.br>
Signed-off-by: default avatarJosiney de Souza <josineys@c3sl.ufpr.br>
parent 7a9e434f
No related branches found
Tags v1.1.1-collect
No related merge requests found
......@@ -76,7 +76,11 @@ function checkUpdate()
function schedule()
{
MIN=$(( $(sed "s/[^0-9]//g" ${CLIENTCONFDIR}/inep) % 60 ))
if test -f "${CLIENTCONFDIR}/inep"; then
MIN=$(( $(sed "s/[^0-9]//g" ${CLIENTCONFDIR}/inep) % 60 ))
else
MIN=$(( $RANDOM % 60 ))
fi
userCron="$(printf\
"${MIN} ${SCHEDULE}\n${NETSCHEDULE}\n@reboot ${PREFIX}/agent.sh\n")"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment