Compare commits
4 commits
c115dbd144
...
e1f4d4350b
Author | SHA1 | Date | |
---|---|---|---|
|
e1f4d4350b | ||
|
a0c2e2cf43 | ||
|
720d37b5a1 | ||
|
3497bd31e9 |
1 changed files with 43 additions and 31 deletions
18
bin/qemush
18
bin/qemush
|
@ -23,14 +23,16 @@ public_help() {
|
||||||
name="$(basename "$0")"
|
name="$(basename "$0")"
|
||||||
cat << EOF
|
cat << EOF
|
||||||
${name}: usage:
|
${name}: usage:
|
||||||
|
${name} active - (default behaviour) list active VMs
|
||||||
${name} start <VM name> - start a VM
|
${name} start <VM name> - start a VM
|
||||||
${name} watch <VM name> - attach VM screen session
|
${name} watch <VM name> - attach VM screen session
|
||||||
${name} active - (default behaviour) list active VMs
|
|
||||||
${name} list - list available VMs
|
${name} list - list available VMs
|
||||||
${name} help - show this help
|
${name} add <VM name> <template> - add launch script based on template
|
||||||
|
${name} rm <VM name> - delete launch script
|
||||||
${name} diskls - list available disk images
|
${name} diskls - list available disk images
|
||||||
${name} diskadd <disk name> <size> - create a disk image
|
${name} diskadd <disk name> <size> - create a disk image
|
||||||
${name} diskrm <disk name> - delete disk image
|
${name} diskrm <disk name> - delete disk image
|
||||||
|
${name} help - show this help
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,10 +79,20 @@ public_diskls() {
|
||||||
ls --color=auto images
|
ls --color=auto images
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public_add() {
|
||||||
|
ln -vs "$2" "bin/${1}"
|
||||||
|
}
|
||||||
|
|
||||||
|
public_rm() {
|
||||||
|
unlink "bin/${1}"
|
||||||
|
}
|
||||||
|
|
||||||
function="$1"
|
function="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
if declare -F | cut -d \ -f 3- | grep '^public_' | sed 's/^public_//' | grep -q "^${function}$"; then
|
if [ -z "$function" ]; then
|
||||||
|
public_active
|
||||||
|
elif declare -F | cut -d \ -f 3- | grep '^public_' | sed 's/^public_//' | grep -q "^${function}$"; then
|
||||||
"public_${function}" "$@"
|
"public_${function}" "$@"
|
||||||
else
|
else
|
||||||
error_usage
|
error_usage
|
||||||
|
|
Loading…
Reference in a new issue