Get only images for LXC or not
[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/precise/current/precise-server-cloudimg-amd64-disk1.img \
14     http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img \
15     http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img \
16     http://mirror.catn.com/pub/catn/images/qcow2/centos6.4-x86_64-gold-master.img \
17     http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 \
18     http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img "
19 fi
20
21 for URL in $URLS
22 do
23 FILENAME=${URL##*/}
24 if [ -f $folder/$FILENAME ];
25 then
26     echo "$FILENAME already downloaded."
27 else
28     wget  -O  $folder/$FILENAME $URL
29 fi
30 done
31
32 echo "To download Windows image get there : https://cloudbase.it/windows-cloud-images/"