Skip to content
Snippets Groups Projects
Commit 5a6416dd authored by edileuton's avatar edileuton
Browse files

agent: Fix permission denied to acess lastexec file


Signed-off-by: default avataredileuton <edileuton@gmail.com>
parent c9759e1d
No related branches found
No related tags found
No related merge requests found
......@@ -246,6 +246,16 @@ cp -a ".md5sum" ".backup/"
printf "OK!\n" >&3
# Restore lastexec
if ! test -z ${LASTEXECBACKUP};then
echo ${LASTEXECBACKUP} > ${LASTEXEC}
fi
# Restore netlastexec
if ! test -z ${NETLASTEXECBACKUP};then
echo ${NETLASTEXECBACKUP} > ${NETLASTEXEC}
fi
# Change files owner
if ! chown -R datasid:datasid "${DATASID_HOME}"; then
printf "FALHA!\n" >&3
......@@ -260,15 +270,6 @@ printf "Executando o agente pela primeira vez... " >&3
# Export a variable to inform the agent that this is its first execution
export FIRST_EXECUTION=1
# Restore lastexec
if ! test -z ${LASTEXECBACKUP};then
echo ${LASTEXECBACKUP} > ${LASTEXEC}
fi
if ! test -z ${NETLASTEXECBACKUP};then
echo ${NETLASTEXECBACKUP} > ${NETLASTEXEC}
fi
# Run the agent and check if its execution was alright, exiting in case of error
su -c "bash ${DATASID_HOME}/bin/datasid-agent.sh" datasid
RETVAL=$?
......
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