modified as huawei lab moved to new location.
[joid.git] / juju / get-cloud-images
1 #!/bin/bash -e
2
3 folder=/srv/data/
4 sudo mkdir $folder || true
5
6 if grep -q 'virt-type: lxd' bundles.yaml; then
7     URLS=" \
8     http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-lxc.tar.gz \
9     http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-root.tar.gz "
10
11 else
12     URLS=" \
13     http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img \
14     http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img \
15     http://mirror.catn.com/pub/catn/images/qcow2/centos6.4-x86_64-gold-master.img \
16     http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 \
17     http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img "
18 fi
19
20 for URL in $URLS
21 do
22 FILENAME=${URL##*/}
23 if [ -f $folder/$FILENAME ];
24 then
25     echo "$FILENAME already downloaded."
26 else
27     wget  -O  $folder/$FILENAME $URL
28 fi
29 done
30
31 echo "To download Windows image get there : https://cloudbase.it/windows-cloud-images/"