mirror of
https://github.com/morgant/basiliskiivm.git
synced 2024-06-01 20:41:29 +00:00
Added 'snapshots' command for listing snapshots in a VM.
This commit is contained in:
parent
69676ca102
commit
15b368cfc5
22
basiliskiivm
22
basiliskiivm
|
@ -51,6 +51,7 @@ function usage() {
|
||||||
echo " info : print basic configuration info for a .BasiliskIIVM"
|
echo " info : print basic configuration info for a .BasiliskIIVM"
|
||||||
echo " list [<path>] : list all .BasiliskIIVM in path (or none for default directory"
|
echo " list [<path>] : list all .BasiliskIIVM in path (or none for default directory"
|
||||||
echo " package : package the current BasiliskII configuration into a .BasiliskIIVM"
|
echo " package : package the current BasiliskII configuration into a .BasiliskIIVM"
|
||||||
|
echo " snapshots <vm>: list all snapshots in a .BasiliskIIVM"
|
||||||
echo " start <vm> : start a BasiliskII instance from a .BasiliskIIVM"
|
echo " start <vm> : start a BasiliskII instance from a .BasiliskIIVM"
|
||||||
echo " status <vm> : get the status of a .BasiliskIIVM"
|
echo " status <vm> : get the status of a .BasiliskIIVM"
|
||||||
echo " stop <vm> : stop a running .BasiliskIIVM"
|
echo " stop <vm> : stop a running .BasiliskIIVM"
|
||||||
|
@ -289,6 +290,24 @@ function vm_stop() {
|
||||||
$success
|
$success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function vm_pkg_list_snapshots() {
|
||||||
|
local success=false
|
||||||
|
|
||||||
|
local vm="$(vm_pkg_name "$1")"
|
||||||
|
if [ -n "$vm" ]; then
|
||||||
|
local snapshots_path="${1}/Snapshots"
|
||||||
|
local count=0
|
||||||
|
if [ -d "$snapshots_path "]; then
|
||||||
|
while IFS= read -r line; do
|
||||||
|
echo "$(basename "$line")"
|
||||||
|
done <<< "$(find "$snapshots_path" -type d -mindepth 1 -maxdepth 1)"
|
||||||
|
fi
|
||||||
|
success=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
$success
|
||||||
|
}
|
||||||
|
|
||||||
function list_vms() {
|
function list_vms() {
|
||||||
success=false
|
success=false
|
||||||
|
|
||||||
|
@ -322,6 +341,9 @@ function main() {
|
||||||
shift
|
shift
|
||||||
list_vms "$1"
|
list_vms "$1"
|
||||||
;;
|
;;
|
||||||
|
"snapshots")
|
||||||
|
vm_pkg_list_snapshots "$1"
|
||||||
|
;;
|
||||||
"start")
|
"start")
|
||||||
shift
|
shift
|
||||||
vm_start "$1"
|
vm_start "$1"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user