download necessary qcow2-files automatically

This commit is contained in:
Raphael Dannecker 2023-07-18 13:19:45 +02:00
parent 406b79bec4
commit b7a0c9fa30
2 changed files with 54 additions and 3 deletions

View file

@ -48,6 +48,30 @@ sync_all_torrents() {
/var/lib/libvirt/images/
rsync -av --password-file=/etc/rsync.secret rsync://vmuser@server:/vmimages-download/xml \
/var/lib/libvirt/images/
rsync -av --password-file=/etc/rsync.secret rsync://vmuser@server:/vmimages-download/desktop/*.desktop \
/usr/share/applications/
update-desktop-database /usr/share/applications
}
create_starter() {
if [[ ! -f "/usr/share/applications/VM_${VM_NAME}_starter.desktop" ]]; then
cat << EOF >"/usr/share/applications/VM_${VM_NAME}_starter.desktop"
[Desktop Entry]
Version=1.0
Type=Application
Name=VMstart: ${VM_NAME}
GenericName=VM starter ${VM_NAME}
Comment=Start VM ${VM_NAME}
#TryExec=konsole
Exec=/usr/local/bin/run-vm.sh ${VM_NAME}
Icon=clementine
Categories=VM;Engineering;
MimeType=image/vnd.dxf;
Keywords=design;VM;diagrams;graphics
Terminal=true
EOF
update-desktop-database /usr/share/applications
fi
}
while getopts ':dat' OPTION; do
@ -57,10 +81,11 @@ while getopts ':dat' OPTION; do
;;
a)
sync_all_images
exit 1
exit 0
;;
t)
sync_all_torrents
exit 0
;;
?)
show_help