mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
Remove snap restore and slightly refactor disk deletion
This commit is contained in:
parent
ed601549c0
commit
91117fb30d
1 changed files with 3 additions and 12 deletions
15
quickemu
15
quickemu
|
@ -1,11 +1,10 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
function vm_delete() {
|
function disk_delete() {
|
||||||
if [ -f "${disk_img}" ]; then
|
if [ -f "${disk_img}" ]; then
|
||||||
rm "${disk_img}"
|
rm "${disk_img}"
|
||||||
echo "SUCCESS! Deleted ${disk_img}"
|
echo "SUCCESS! Deleted ${disk_img}"
|
||||||
fi
|
fi
|
||||||
exit 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function vm_restore() {
|
function vm_restore() {
|
||||||
|
@ -195,7 +194,6 @@ function usage() {
|
||||||
echo "You can also pass optional parameters"
|
echo "You can also pass optional parameters"
|
||||||
echo " --delete : Delete the disk image."
|
echo " --delete : Delete the disk image."
|
||||||
echo " --efi : Enable EFI BIOS."
|
echo " --efi : Enable EFI BIOS."
|
||||||
echo " --restore : Restore the snapshot."
|
|
||||||
echo " --snapshot : Create a disk snapshot."
|
echo " --snapshot : Create a disk snapshot."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
@ -205,7 +203,6 @@ ENABLE_EFI=0
|
||||||
readonly QEMU="/snap/bin/qemu-virgil"
|
readonly QEMU="/snap/bin/qemu-virgil"
|
||||||
readonly QEMU_IMG="/snap/bin/qemu-virgil.qemu-img"
|
readonly QEMU_IMG="/snap/bin/qemu-virgil.qemu-img"
|
||||||
readonly LAUNCHER=$(basename $0)
|
readonly LAUNCHER=$(basename $0)
|
||||||
RESTORE=0
|
|
||||||
SNAPSHOT=0
|
SNAPSHOT=0
|
||||||
VM=""
|
VM=""
|
||||||
|
|
||||||
|
@ -217,9 +214,6 @@ while [ $# -gt 0 ]; do
|
||||||
-delete|--delete)
|
-delete|--delete)
|
||||||
DELETE=1
|
DELETE=1
|
||||||
shift;;
|
shift;;
|
||||||
-restore|--restore)
|
|
||||||
RESTORE=1
|
|
||||||
shift;;
|
|
||||||
-snapshot|--snapshot)
|
-snapshot|--snapshot)
|
||||||
SNAPSHOT=1
|
SNAPSHOT=1
|
||||||
shift;;
|
shift;;
|
||||||
|
@ -250,11 +244,8 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${DELETE} -eq 1 ]; then
|
if [ ${DELETE} -eq 1 ]; then
|
||||||
vm_delete
|
disk_delete
|
||||||
fi
|
exit 0
|
||||||
|
|
||||||
if [ ${RESTORE} -eq 1 ]; then
|
|
||||||
vm_restore
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${SNAPSHOT} -eq 1 ]; then
|
if [ ${SNAPSHOT} -eq 1 ]; then
|
||||||
|
|
Loading…
Reference in a new issue