info "Executing: ${cmd}"
IMAGE="fake_image_info"
BASE_FILE_NAME="fake-${output_base}"
- DOWNLOAD_URL="fake_download_url"
+ DOWNLOAD_URL="${image_download_url}"
else
debug "Executing: ${cmd}"
IMAGE_INFO=$( eval ${cmd} )
debug "Got download URL: '${CYAN}${DOWNLOAD_URL}${NORMAL}'."
info "Got output file: '${GREEN}${OUTPUT_FILE}${NORMAL}'."
+
+ if [[ -z "${BASE_FILE_NAME}" || "${BASE_FILE_NAME}" =~ ^null || -z "${DOWNLOAD_URL}" || "${DOWNLOAD_URL}" =~ ^null ]] ; then
+ error "Error getting image information for RHEL DVD iso image." >&2
+ exit 5
+ fi
+
+}
+
+#------------------------------------------------------------------------------
+download_image() {
+
+ info "Downloading '${GREEN}${OUTPUT_FILE}${NORMAL}' from URL '${GREEN}${DOWNLOAD_URL}${NORMAL}' ..."
+
+ local cmd="curl -o '${OUTPUT_FILE}' '${DOWNLOAD_URL}'"
+
+ if [[ "${SIMULATE}" == "y" ]] ; then
+ info "Executing: ${cmd}"
+ else
+ debug "Executing: ${cmd}"
+ eval ${cmd}
+ fi
}
#------------------------------------------------------------------------------
set_locale "en_US.utf8"
get_access_token
get_image_info
+ download_image
}