diff --git a/build-install-package b/build-install-package index 0a06236a651917b788ac72f80f5122fe21ab5ef6..359a2f88d2863b101cbb0f1f5011917563294d18 100755 --- a/build-install-package +++ b/build-install-package @@ -48,7 +48,13 @@ printf "Creating tree..." rm -Rf "/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" echo "${INEP}" > "/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" md5sum "${FILE}" |cut -d' ' -f1 > \ "/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" @@ -82,7 +93,10 @@ printf "done.\n" printf "Packaging..." 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 MD5_CHECK=$(md5sum SEED2.tgz | awk '{print $1}')