Skip to content

Commit

Permalink
Display message when CoCo disk creation abort (#709)
Browse files Browse the repository at this point in the history
Fix ALEPH-211
  • Loading branch information
olethanh authored Oct 9, 2024
1 parent 90bae31 commit 49d91d2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/example_confidential_image/build_debian_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ cleanup() {
return
fi
CLEANUP_DONE=true
echo "Cleaning up..."
if mountpoint -q "${MOUNT_POINT}"; then
sudo umount --recursive "${MOUNT_POINT}" || echo "Failed to unmount ${MOUNT_POINT}"
fi
Expand All @@ -43,6 +42,15 @@ cleanup() {
# - TERM (SIGTERM): Signal 15, sent by the kill command to request the process to terminate gracefully.
trap cleanup EXIT HUP INT QUIT PIPE TERM

error_handler() {
echo ""
echo "An error occured while building the image and the process was not completed properly."
echo "Please check the log, fix any error if required and restart the script."
echo "For more help see https://docs.aleph.im/computing/confidential/encrypted-disk/"
}

trap error_handler ERR

usage() {
cat <<USAGE >&2
Usage:
Expand Down

0 comments on commit 49d91d2

Please sign in to comment.