Downloading changed images takes a lot of time, so let's ask the user before
This commit is contained in:
parent
23a9b6ff97
commit
a507c1decf
1 changed files with 12 additions and 2 deletions
|
@ -79,9 +79,19 @@ delete_outdated_image() {
|
||||||
cd "${VM_SYSDIR}"
|
cd "${VM_SYSDIR}"
|
||||||
qcowsize=$(stat -c%s "${FILENAME}")
|
qcowsize=$(stat -c%s "${FILENAME}")
|
||||||
if [[ -f "${FILENAME}.torrent" ]] && [[ "${qcowsize}" != $(get_image_size "${FILENAME}.torrent") ]]; then
|
if [[ -f "${FILENAME}.torrent" ]] && [[ "${qcowsize}" != $(get_image_size "${FILENAME}.torrent") ]]; then
|
||||||
|
cat << EOF >&2
|
||||||
|
|
||||||
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
Es wurde eine neueres VM-Image auf dem Server gefunden.
|
||||||
|
Das Herunterladen des Images via WLAN benötigt viel Zeit.
|
||||||
|
EOF
|
||||||
|
read -rp "Soll das neue Image wirklich herunter geladen werden? j/n " answer
|
||||||
|
if [[ "${answer,,}" == "j" ]]; then
|
||||||
sudo vm-aria2 stop "${FILENAME%.qcow2}"
|
sudo vm-aria2 stop "${FILENAME%.qcow2}"
|
||||||
rm -f "${FILENAME}"
|
rm -f "${FILENAME}"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
update_usage_information() {
|
update_usage_information() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue