Permalink
Browse files

Merge remote-tracking branch 'rcmachado/master'

  • Loading branch information...
2 parents e4afe57 + 6dc1ab8 commit 2123b4845f8c591f1f8b37276c26fdc46509539d @xdissent committed May 29, 2012
Showing with 12 additions and 13 deletions.
  1. +12 −13 ievms.sh
View
@@ -6,6 +6,8 @@ set -o errtrace
set -o errexit
set -o pipefail
+CURL_EXTRA_OPTS="--limit-rate 50k"
+
log() { printf "$*\n" ; return $? ; }
fail() { log "\nERROR: $*\n" ; exit 1 ; }
@@ -91,26 +93,22 @@ check_unrar() {
build_ievm() {
case $1 in
6)
- url="http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_XP_IE6.exe"
- archive="Windows_XP_IE6.exe"
+ urls="http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_XP_IE6.exe"
vhd="Windows XP.vhd"
vm_type="WindowsXP"
;;
7)
- url="http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_Vista_IE7.part0{1.exe,2.rar,3.rar,4.rar,5.rar,6.rar}"
- archive="Windows_Vista_IE7.part01.exe"
+ urls=`echo http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_Vista_IE7.part0{1.exe,2.rar,3.rar,4.rar,5.rar,6.rar}`
vhd="Windows Vista.vhd"
vm_type="WindowsVista"
;;
8)
- url="http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_7_IE8.part0{1.exe,2.rar,3.rar,4.rar}"
- archive="Windows_7_IE8.part01.exe"
+ urls=`echo http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_7_IE8.part0{1.exe,2.rar,3.rar,4.rar}`
vhd="Win7_IE8.vhd"
vm_type="Windows7"
;;
9)
- url="http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_7_IE9.part0{1.exe,2.rar,3.rar,4.rar,5.rar,6.rar,7.rar}"
- archive="Windows_7_IE9.part01.exe"
+ urls=`echo http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_7_IE9.part0{1.exe,2.rar,3.rar,4.rar,5.rar,6.rar,7.rar}`
vhd="Windows 7.vhd"
vm_type="Windows7"
;;
@@ -128,15 +126,16 @@ build_ievm() {
if [[ ! -f "${vhd}" ]]
then
- log "Checking for downloaded VHD at ${vhd_path}/${archive}"
- if [[ ! -f "${archive}" ]]
- then
+ log "Checking for downloaded VHDs at ${vhd_path}/"
+ for url in $urls
+ do
+ archive=`basename $url`
log "Downloading VHD from ${url} to ${ievms_home}/"
- if ! curl -L -O "${url}"
+ if ! curl $CURL_EXTRA_OPTS -C - -L -O "${url}"
then
fail "Failed to download ${url} to ${vhd_path}/ using 'curl', error code ($?)"
fi
- fi
+ done
rm -f "${vhd_path}/*.vmc"

0 comments on commit 2123b48

Please sign in to comment.