From b9b96f6467ab5003e819b5955c04b794d4e33edc Mon Sep 17 00:00:00 2001 From: Ahurac Date: Sun, 24 Mar 2024 22:52:37 +0100 Subject: [PATCH] qemush : n'exporter QEMUSH_NAME que quand on en a besoin --- bin/qemush | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/qemush b/bin/qemush index 3436b26..26c70d7 100755 --- a/bin/qemush +++ b/bin/qemush @@ -51,7 +51,7 @@ error_usage() { # Function to start a virtual machine public_start() { - QEMUSH_NAME="$1" + export QEMUSH_NAME="$1" set -- "$@" \ -name "$QEMUSH_NAME" \ @@ -66,7 +66,7 @@ public_start() { # Attach to a running virtual machine output, the latest opened if no # argument is provided public_attach() { - QEMUSH_NAME="$1" + export QEMUSH_NAME="$1" shift exec socat -,rawer,escape=15 "UNIX-CONNECT:$(pathof socket)" @@ -90,7 +90,7 @@ public_ls() { # Create a copy-on-write disk for a virtual machine public_diskadd() { - QEMUSH_NAME="$1" + export QEMUSH_NAME="$1" shift exec qemu-img create -f qcow2 "$(pathof disk)" "$1" } @@ -98,7 +98,7 @@ public_diskadd() { # Delete a disk public_diskrm() { for disk in "$@"; do - QEMUSH_NAME="$disk" + export QEMUSH_NAME="$disk" rm -vi -- "$(pathof disk)" done } @@ -170,7 +170,7 @@ public_do() { # Expose SPICE via TCP public_spice() { - QEMUSH_NAME="$1" + export QEMUSH_NAME="$1" if [ -n "$2" ]; then port=$2 else