1
0
Fork 0
forked from ahurac/dotfiles

qemush : ajout d'execs à la fin de fonctions finales

This commit is contained in:
Hippolyte Chauvin 2023-12-01 16:08:43 +01:00
parent ff2a758af6
commit 2d53034837

View file

@ -35,7 +35,7 @@ perror() {
public_help() { public_help() {
local name local name
name="$(basename "$0")" name="$(basename "$0")"
cat << EOF exec cat << EOF
${name}: usage: ${name}: usage:
${name} active - (default behaviour) list active VMs ${name} active - (default behaviour) list active VMs
${name} start <VM name> - start a VM ${name} start <VM name> - start a VM
@ -61,20 +61,20 @@ public_start() {
local vm_name="$1" local vm_name="$1"
shift shift
screen -S "$vm_name" "$vm_name" "$@" exec screen -S "$vm_name" "$vm_name" "$@"
} }
public_watch() { public_watch() {
screen -dr "$1" exec screen -dr "$1"
} }
public_active() { public_active() {
screen -ls exec screen -ls
} }
public_ls() { public_ls() {
echo "Available machines:" echo "Available machines:"
ls "$bin" exec ls "$bin"
} }
diskpath() { diskpath() {
@ -82,16 +82,16 @@ diskpath() {
} }
public_diskadd() { public_diskadd() {
qemu-img create -f qcow2 "$(diskpath "$1")" "$2" exec qemu-img create -f qcow2 "$(diskpath "$1")" "$2"
} }
public_diskrm() { public_diskrm() {
rm -vi -- "$(diskpath "$1")" exec rm -vi -- "$(diskpath "$1")"
} }
public_diskls() { public_diskls() {
echo "Available disks:" echo "Available disks:"
ls "$images" exec ls "$images"
} }
public_edit() { public_edit() {
@ -99,15 +99,15 @@ public_edit() {
} }
public_rm() { public_rm() {
rm -vi -- "${bin}/${1}" exec rm -vi -- "${bin}/${1}"
} }
public_shell() { public_shell() {
bash -i exec bash -i
} }
public_cat() { public_cat() {
"$cat" "${bin}/${1}" exec "$cat" "${bin}/${1}"
} }
function="$1" function="$1"