diff --git a/bin/cloud-local.sh b/bin/cloud-local.sh index 3fdcb5c..7346717 100755 --- a/bin/cloud-local.sh +++ b/bin/cloud-local.sh @@ -38,8 +38,7 @@ function download_packages { if [[ ! -z ${pkg_pre_download+x} ]]; then # Does that folder actually exist? if [[ -d ${pkg_pre_download} ]] ; then - test -d ${CLOUD_HOME}/pkg || rmdir ${CLOUD_HOME}/pkg - test -h ${CLOUD_HOME}/pkg && rm ${CLOUD_HOME}/pkg + rm -f ${CLOUD_HOME}/pkg ln -s ${pkg_pre_download} ${CLOUD_HOME}/pkg echo "Skipping downloads... using ${pkg_pre_download}" return 0 @@ -87,7 +86,7 @@ function download_packages { "${apache_archive_url}/zookeeper/zookeeper-${pkg_zookeeper_ver}/zookeeper-${pkg_zookeeper_ver}.tar.gz" "${apache_archive_url}/spark/spark-${pkg_spark_ver}/spark-${pkg_spark_ver}-bin-${pkg_spark_hadoop_ver}.tgz") - + if [[ "$kafka_enabled" -eq 1 ]]; then urls=("${urls[@]}" "${apache_archive_url}/kafka/${pkg_kafka_ver}/kafka_${pkg_kafka_scala_ver}-${pkg_kafka_ver}.tgz") fi @@ -108,7 +107,7 @@ function download_packages { fname=$(basename "$x"); echo "fetching ${x}"; wget -c -O "${CLOUD_HOME}/pkg/${fname}" "$x" || { rm -f "${CLOUD_HOME}/pkg/${fname}"; echo "Error Downloading: ${fname}"; errorList="${errorList} ${x} ${NL}"; }; - done + done if [[ -n "${errorList}" ]]; then echo "Failed to download: ${NL} ${errorList}";