From e1e9a3e4678def9bf74888e3bcc7101b2aaab8ad Mon Sep 17 00:00:00 2001 From: Brielle Bruns Date: Tue, 10 Apr 2018 09:41:31 -0600 Subject: [PATCH] Download images to images/ and store them there, as to not clutter up the main dir. Add images/ directory to gitignore --- .gitignore | 2 ++ images/.gitkeep | 0 virt-install-cloud.sh | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 images/.gitkeep diff --git a/.gitignore b/.gitignore index a372161..fa5b7f4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /*.iso /output/* !/output/.gitkeep +/images/* +!/images/.gitkeep diff --git a/images/.gitkeep b/images/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/virt-install-cloud.sh b/virt-install-cloud.sh index 23823ef..bbd3f7d 100755 --- a/virt-install-cloud.sh +++ b/virt-install-cloud.sh @@ -8,7 +8,7 @@ # # # Heavily Modified By: Brielle Bruns -# Date: 04/09/2018 +# Date: 04/10/2018 # URL: https://git.sosdg.org/brielle/virt-install-cloud # # ref. http://mojodna.net/2014/05/14/kvm-libvirt-and-ubuntu-14-04.html @@ -118,9 +118,9 @@ case $IMG in ;; esac -if [[ ! -f ${IMG_NAME} ]]; then +if [[ ! -f images/${IMG_NAME} ]]; then echo "Downloading image ${IMG_NAME}..." - wget ${IMG_URL}/${IMG_NAME} -O ${IMG_NAME} + wget ${IMG_URL}/${IMG_NAME} -O images/${IMG_NAME} chmod 644 ${IMG_NAME} else echo "Using existing image ${IMG_NAME}..." @@ -152,7 +152,7 @@ virsh pool-refresh ${POOL} # copy image to libvirt's pool if [[ ! -f ${POOL_PATH}/${IMG_NAME} ]]; then - cp ${IMG_NAME} ${POOL_PATH} + cp images/${IMG_NAME} ${POOL_PATH} virsh pool-refresh ${POOL} fi