#!/bin/bash bold=$(tput bold) normal=$(tput sgr0) log() { echo "${bold}${1}${normal}" } # $1 - current value # $2 - maximum value (the "100%" value) progressbar() { local width=80 if [ $1 -eq -1 ]; then printf "\r %*s\r" "$width" else i=$(($1 * $width / $2)) j=$(($width - $i)) printf "\r[%*s" "$i" | tr ' ' '#' printf "%*s]\r" "$j" fi } blue_marble_url_prefix="https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73909/" blue_marble_prefix="world.topo.bathy.200412.3x21600x21600." if [ ! -d assets/nasa_blue_marble ]; then log "Downloading NASA Blue Marble images ..." wget --directory-prefix assets/nasa_blue_marble --quiet --show-progress \ "${blue_marble_url_prefix}${blue_marble_prefix}A1.jpg" \ "${blue_marble_url_prefix}${blue_marble_prefix}A2.jpg" \ "${blue_marble_url_prefix}${blue_marble_prefix}B1.jpg" \ "${blue_marble_url_prefix}${blue_marble_prefix}B2.jpg" \ "${blue_marble_url_prefix}${blue_marble_prefix}C1.jpg" \ "${blue_marble_url_prefix}${blue_marble_prefix}C2.jpg" \ "${blue_marble_url_prefix}${blue_marble_prefix}D1.jpg" \ "${blue_marble_url_prefix}${blue_marble_prefix}D2.jpg" fi if [ ! -d assets/noaa_globe ]; then log "Downloading NOAA GLOBE elevation data ..." temp_file=$(mktemp) wget --quiet --show-progress --output-document $temp_file \ https://www.ngdc.noaa.gov/mgg/topo/DATATILES/elev/all10g.zip unzip -j $temp_file -d assets/noaa_globe rm $temp_file fi