Browse Source

Download images to images/ and store them there, as to not clutter up the main dir. Add images/ directory to gitignore

Brielle Bruns 10 months ago
parent
commit
e1e9a3e467
3 changed files with 6 additions and 4 deletions
  1. 2
    0
      .gitignore
  2. 0
    0
      images/.gitkeep
  3. 4
    4
      virt-install-cloud.sh

+ 2
- 0
.gitignore View File

@@ -2,3 +2,5 @@
2 2
 /*.iso
3 3
 /output/*
4 4
 !/output/.gitkeep
5
+/images/*
6
+!/images/.gitkeep

+ 0
- 0
images/.gitkeep View File


+ 4
- 4
virt-install-cloud.sh View File

@@ -8,7 +8,7 @@
8 8
 #
9 9
 #
10 10
 # Heavily Modified By:  Brielle Bruns
11
-# Date: 04/09/2018
11
+# Date: 04/10/2018
12 12
 # URL: https://git.sosdg.org/brielle/virt-install-cloud
13 13
 #
14 14
 # ref. http://mojodna.net/2014/05/14/kvm-libvirt-and-ubuntu-14-04.html
@@ -118,9 +118,9 @@ case $IMG in
118 118
             ;;
119 119
 esac
120 120
 
121
-if [[ ! -f ${IMG_NAME} ]]; then
121
+if [[ ! -f images/${IMG_NAME} ]]; then
122 122
   echo "Downloading image ${IMG_NAME}..."
123
-  wget ${IMG_URL}/${IMG_NAME} -O ${IMG_NAME}
123
+  wget ${IMG_URL}/${IMG_NAME} -O images/${IMG_NAME}
124 124
   chmod 644 ${IMG_NAME}
125 125
 else
126 126
   echo "Using existing image ${IMG_NAME}..."
@@ -152,7 +152,7 @@ virsh pool-refresh ${POOL}
152 152
 
153 153
 # copy image to libvirt's pool
154 154
 if [[ ! -f ${POOL_PATH}/${IMG_NAME} ]]; then
155
-  cp ${IMG_NAME} ${POOL_PATH}
155
+  cp images/${IMG_NAME} ${POOL_PATH}
156 156
   virsh pool-refresh ${POOL}
157 157
 fi
158 158
 

Loading…
Cancel
Save