qemush : commande active -> running

This commit is contained in:
Ahurac 2024-01-25 14:41:20 +01:00
parent d515a0bb23
commit 12eeb64347

View file

@ -38,7 +38,7 @@ public_help() {
exec cat << EOF
${name}: usage:
${name} active - (default behaviour) list active VMs
${name} running - (default behaviour) list running VMs
${name} start <VM name> - start a VM
${name} watch <VM name> - attach VM screen session
${name} ls - list available VMs
@ -84,7 +84,7 @@ public_watch() {
}
# List running virtual machines
public_active() {
public_running() {
cd || return
echo "Running machines:"
set -- $ls -t sockets "$@"
@ -182,7 +182,7 @@ shift
# Defauts to `active` if no function is supplied; else checks for a public
# function named after the argument; else fails
if [ -z "$function" ]; then
public_active
public_running
elif declare -F | cut -d \ -f 3- | grep '^public_' | sed 's/^public_//' | grep -q "^${function}$"; then
"public_${function}" "$@"
else