fixed bugs

This commit is contained in:
Raphael Dannecker 2023-07-04 11:42:32 +02:00
parent 4e5eebe367
commit 983e915090
4 changed files with 20 additions and 9 deletions

View file

@ -27,7 +27,7 @@ upload_image() {
ln -f "${VM_DIR}/${VM_NAME}.qcow2" "/var/lib/libvirt/images/${VM_NAME}.qcow2"
fi
# check if VM-Machine-Definition XML exists
if [[ ! (-f "/var/lib/libvirt/images/xml/${VM_NAME}.xml" || -f "${VM_DIR}/xml/${VM_NAME}") ]]; then
if [[ ! (-f "/var/lib/libvirt/images/xml/${VM_NAME}.xml" || -f "${VM_DIR}/xml/${VM_NAME}.xml") ]]; then
echo "File not found ${VM_NAME}.xml" >&2
exit 1
fi
@ -36,7 +36,7 @@ upload_image() {
&& ( -f "/var/lib/libvirt/images/xml/${VM_NAME}.xml" && $(cmp -s "${VM_DIR}/xml/${VM_NAME}.xml" "/var/lib/libvirt/images/xml/${VM_NAME}.xml") \
|| ! -f "/var/lib/libvirt/images/xml/${VM_NAME}.xml") ]]; then
echo "copy private VM-Maschine-Definition XML to system-dir"
cp "${VM_DIR}/${VM_NAME}.xml" "/var/lib/libvirt/images/${VM_NAME}.xml"
cp "${VM_DIR}/xml/${VM_NAME}.xml" "/var/lib/libvirt/images/xml/"
fi
# (re-) create torrent file
/usr/local/bin/vmimage-torrent create "${VM_NAME}.qcow2"