Download images to images/ and store them there, as to not clutter up the main dir. Add images/ directory to gitignore
parent
eb46cdb392
commit
e1e9a3e467
|
@ -2,3 +2,5 @@
|
||||||
/*.iso
|
/*.iso
|
||||||
/output/*
|
/output/*
|
||||||
!/output/.gitkeep
|
!/output/.gitkeep
|
||||||
|
/images/*
|
||||||
|
!/images/.gitkeep
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Heavily Modified By: Brielle Bruns
|
# Heavily Modified By: Brielle Bruns
|
||||||
# Date: 04/09/2018
|
# Date: 04/10/2018
|
||||||
# URL: https://git.sosdg.org/brielle/virt-install-cloud
|
# URL: https://git.sosdg.org/brielle/virt-install-cloud
|
||||||
#
|
#
|
||||||
# ref. http://mojodna.net/2014/05/14/kvm-libvirt-and-ubuntu-14-04.html
|
# ref. http://mojodna.net/2014/05/14/kvm-libvirt-and-ubuntu-14-04.html
|
||||||
|
@ -118,9 +118,9 @@ case $IMG in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ ! -f ${IMG_NAME} ]]; then
|
if [[ ! -f images/${IMG_NAME} ]]; then
|
||||||
echo "Downloading image ${IMG_NAME}..."
|
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}
|
chmod 644 ${IMG_NAME}
|
||||||
else
|
else
|
||||||
echo "Using existing image ${IMG_NAME}..."
|
echo "Using existing image ${IMG_NAME}..."
|
||||||
|
@ -152,7 +152,7 @@ virsh pool-refresh ${POOL}
|
||||||
|
|
||||||
# copy image to libvirt's pool
|
# copy image to libvirt's pool
|
||||||
if [[ ! -f ${POOL_PATH}/${IMG_NAME} ]]; then
|
if [[ ! -f ${POOL_PATH}/${IMG_NAME} ]]; then
|
||||||
cp ${IMG_NAME} ${POOL_PATH}
|
cp images/${IMG_NAME} ${POOL_PATH}
|
||||||
virsh pool-refresh ${POOL}
|
virsh pool-refresh ${POOL}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue