Compare commits
2 commits
ff2a758af6
...
2cdd2427a2
Author | SHA1 | Date | |
---|---|---|---|
|
2cdd2427a2 | ||
|
2d53034837 |
1 changed files with 14 additions and 12 deletions
26
bin/qemush
26
bin/qemush
|
@ -35,7 +35,7 @@ perror() {
|
|||
public_help() {
|
||||
local name
|
||||
name="$(basename "$0")"
|
||||
cat << EOF
|
||||
exec cat << EOF
|
||||
${name}: usage:
|
||||
${name} active - (default behaviour) list active VMs
|
||||
${name} start <VM name> - start a VM
|
||||
|
@ -61,20 +61,20 @@ public_start() {
|
|||
local vm_name="$1"
|
||||
shift
|
||||
|
||||
screen -S "$vm_name" "$vm_name" "$@"
|
||||
exec screen -S "$vm_name" "$vm_name" "$@"
|
||||
}
|
||||
|
||||
public_watch() {
|
||||
screen -dr "$1"
|
||||
exec screen -dr "$1"
|
||||
}
|
||||
|
||||
public_active() {
|
||||
screen -ls
|
||||
exec screen -ls
|
||||
}
|
||||
|
||||
public_ls() {
|
||||
echo "Available machines:"
|
||||
ls "$bin"
|
||||
exec ls "$bin"
|
||||
}
|
||||
|
||||
diskpath() {
|
||||
|
@ -82,32 +82,34 @@ diskpath() {
|
|||
}
|
||||
|
||||
public_diskadd() {
|
||||
qemu-img create -f qcow2 "$(diskpath "$1")" "$2"
|
||||
exec qemu-img create -f qcow2 "$(diskpath "$1")" "$2"
|
||||
}
|
||||
|
||||
public_diskrm() {
|
||||
rm -vi -- "$(diskpath "$1")"
|
||||
exec rm -vi -- "$(diskpath "$1")"
|
||||
}
|
||||
|
||||
public_diskls() {
|
||||
echo "Available disks:"
|
||||
ls "$images"
|
||||
exec ls "$images"
|
||||
}
|
||||
|
||||
public_edit() {
|
||||
"$EDITOR" "${bin}/${1}"
|
||||
local file="${bin}/${1}"
|
||||
"$EDITOR" "$file"
|
||||
exec chmod 740 "$file"
|
||||
}
|
||||
|
||||
public_rm() {
|
||||
rm -vi -- "${bin}/${1}"
|
||||
exec rm -vi -- "${bin}/${1}"
|
||||
}
|
||||
|
||||
public_shell() {
|
||||
bash -i
|
||||
exec bash -i
|
||||
}
|
||||
|
||||
public_cat() {
|
||||
"$cat" "${bin}/${1}"
|
||||
exec "$cat" "${bin}/${1}"
|
||||
}
|
||||
|
||||
function="$1"
|
||||
|
|
Loading…
Reference in a new issue