#!/bin/sh set -e df_tardest="df.tar.bz2" save_tardest="test_save.tgz" selfmd5=$(openssl md5 < "$0") echo $selfmd5 cd "$(dirname "$0")" echo "DF_VERSION: $DF_VERSION" echo "DF_FOLDER: $DF_FOLDER" mkdir -p "$DF_FOLDER" # back out of df_linux cd "$DF_FOLDER/.." if [ -f receipt ]; then if [ "$selfmd5" != "$(cat receipt)" ]; then echo "download-df.sh changed; re-downloading tarballs" rm receipt else echo "Already downloaded $DF_VERSION tarballs" fi fi if [ ! -f receipt ]; then rm -f "$df_tardest" "$save_tardest" minor=$(echo "$DF_VERSION" | cut -d. -f2) patch=$(echo "$DF_VERSION" | cut -d. -f3) echo "Downloading DF $DF_VERSION" while read url; do echo "Attempting download: ${url}" if wget -v "$url" -O "$df_tardest"; then break fi done < receipt ls