Skip to content

Commit

Permalink
Merge remote-tracking branch 'rcmachado/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
xdissent committed May 29, 2012
2 parents e4afe57 + 6dc1ab8 commit 2123b48
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions ievms.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ set -o errtrace
set -o errexit set -o errexit
set -o pipefail set -o pipefail


CURL_EXTRA_OPTS="--limit-rate 50k"

log() { printf "$*\n" ; return $? ; } log() { printf "$*\n" ; return $? ; }


fail() { log "\nERROR: $*\n" ; exit 1 ; } fail() { log "\nERROR: $*\n" ; exit 1 ; }
Expand Down Expand Up @@ -91,26 +93,22 @@ check_unrar() {
build_ievm() { build_ievm() {
case $1 in case $1 in
6) 6)
url="http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_XP_IE6.exe" urls="http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_XP_IE6.exe"
archive="Windows_XP_IE6.exe"
vhd="Windows XP.vhd" vhd="Windows XP.vhd"
vm_type="WindowsXP" vm_type="WindowsXP"
;; ;;
7) 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}" 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}`
archive="Windows_Vista_IE7.part01.exe"
vhd="Windows Vista.vhd" vhd="Windows Vista.vhd"
vm_type="WindowsVista" vm_type="WindowsVista"
;; ;;
8) 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}" 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}`
archive="Windows_7_IE8.part01.exe"
vhd="Win7_IE8.vhd" vhd="Win7_IE8.vhd"
vm_type="Windows7" vm_type="Windows7"
;; ;;
9) 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}" 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}`
archive="Windows_7_IE9.part01.exe"
vhd="Windows 7.vhd" vhd="Windows 7.vhd"
vm_type="Windows7" vm_type="Windows7"
;; ;;
Expand All @@ -128,15 +126,16 @@ build_ievm() {
if [[ ! -f "${vhd}" ]] if [[ ! -f "${vhd}" ]]
then then


log "Checking for downloaded VHD at ${vhd_path}/${archive}" log "Checking for downloaded VHDs at ${vhd_path}/"
if [[ ! -f "${archive}" ]] for url in $urls
then do
archive=`basename $url`
log "Downloading VHD from ${url} to ${ievms_home}/" log "Downloading VHD from ${url} to ${ievms_home}/"
if ! curl -L -O "${url}" if ! curl $CURL_EXTRA_OPTS -C - -L -O "${url}"
then then
fail "Failed to download ${url} to ${vhd_path}/ using 'curl', error code ($?)" fail "Failed to download ${url} to ${vhd_path}/ using 'curl', error code ($?)"
fi fi
fi done


rm -f "${vhd_path}/*.vmc" rm -f "${vhd_path}/*.vmc"


Expand Down

0 comments on commit 2123b48

Please sign in to comment.