Skip to content
Snippets Groups Projects
Commit e4902a3f authored by Erik Alexandre Pucci's avatar Erik Alexandre Pucci
Browse files

build-install-package: Added checks at some important points


These checks force the script to exit on error.

Signed-off-by: default avatarErik Alexandre Pucci <eap08@c3sl.ufpr.br>
Acked-by: default avatarDanilo Kiyoshi Simizu Yorinori <danilok@c3sl.ufpr.br>
Acked-by: default avatarTiago Rodrigo Kepe <trk08@c3sl.ufpr.br>
parent 7cffcc33
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,13 @@ printf "Creating tree..." ...@@ -48,7 +48,13 @@ printf "Creating tree..."
rm -Rf "/tmp/${INEP}" rm -Rf "/tmp/${INEP}"
mkdir -p "/tmp/${INEP}" mkdir -p "/tmp/${INEP}"
cp -r "${AGENT_FILES}/SEED2-run" "/tmp/${INEP}/SEED2" # Copy the agent files to the temporary directory where the installation package
# will be generated
if ! cp -r "${AGENT_FILES}/SEED2-run" "/tmp/${INEP}/SEED2"; then
printf "ERROR: Failed to copy agent files.\n"
exit 2
fi
mkdir -p "/tmp/${INEP}/SEED2/client/conf" mkdir -p "/tmp/${INEP}/SEED2/client/conf"
echo "${INEP}" > "/tmp/${INEP}/SEED2/client/conf/inep" echo "${INEP}" > "/tmp/${INEP}/SEED2/client/conf/inep"
FILE="/tmp/${INEP}/SEED2/client/conf/inep" FILE="/tmp/${INEP}/SEED2/client/conf/inep"
...@@ -74,7 +80,12 @@ FILE="/tmp/${INEP}/SEED2/.backup/client/conf/proxy" ...@@ -74,7 +80,12 @@ FILE="/tmp/${INEP}/SEED2/.backup/client/conf/proxy"
md5sum "${FILE}" |cut -d' ' -f1 > \ md5sum "${FILE}" |cut -d' ' -f1 > \
"/tmp/${INEP}/SEED2/.md5sum/.backup/client/conf/proxy" "/tmp/${INEP}/SEED2/.md5sum/.backup/client/conf/proxy"
cp -r "${AGENT_FILES}/bootstrap-install" "/tmp/${INEP}" # Copy the bootstrap-install to the temporary directory
if ! cp -r "${AGENT_FILES}/${BOOTSTRAP}" "/tmp/${INEP}"; then
printf "ERROR: Failed to copy ${BOOTSTRAP} to the %b" \
"temporary directory.\n"
exit 3
fi
printf "done.\n" printf "done.\n"
...@@ -82,7 +93,10 @@ printf "done.\n" ...@@ -82,7 +93,10 @@ printf "done.\n"
printf "Packaging..." printf "Packaging..."
cd "/tmp/${INEP}" cd "/tmp/${INEP}"
tar -czf SEED2.tgz SEED2 if ! tar -czf SEED2.tgz SEED2; then
printf "ERROR: Failed to compress the agent package.\n"
exit 4
fi
# Create the tar md5 and compute the bootstrap lines # Create the tar md5 and compute the bootstrap lines
MD5_CHECK=$(md5sum SEED2.tgz | awk '{print $1}') MD5_CHECK=$(md5sum SEED2.tgz | awk '{print $1}')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment