From 42734333b0787d292817470e797db9dc5075bccb Mon Sep 17 00:00:00 2001 From: Ahurac Date: Sun, 24 Mar 2024 23:27:07 +0100 Subject: [PATCH] =?UTF-8?q?qemush=20:=20ajout=20de=20jolis=20retours=20?= =?UTF-8?q?=C3=A0=20la=20ligne?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/qemush | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/qemush b/bin/qemush index 247fc64..f7b1bf6 100755 --- a/bin/qemush +++ b/bin/qemush @@ -46,6 +46,7 @@ EOF error_usage() { perror "invalid usage" >&2 public_help + return 1 } @@ -57,6 +58,7 @@ public_start() { -name "$QEMUSH_NAME" \ -monitor "unix:$(pathof socket),server,nowait" \ -daemonize + if ! "$@"; then perror "error launching virtual machine \"${QEMUSH_NAME}\"" return 2 @@ -75,6 +77,7 @@ public_attach() { # List running virtual machines public_running() { cd || return + echo "Running machines:" exec ls -t sockets/monitors } @@ -82,6 +85,7 @@ public_running() { # List available virtual machines entrypoints public_ls() { cd || return + echo "Available machines:" exec ls launchers } @@ -97,6 +101,7 @@ public_diskadd() { public_diskrm() { for disk in "$@"; do export QEMUSH_NAME="$disk" + rm -vi -- "$(pathof disk)" done } @@ -104,6 +109,7 @@ public_diskrm() { # List available disks public_diskls() { cd || return + echo "Available disks:" exec ls disks } @@ -125,6 +131,7 @@ public_edit() { # Delete a virtual machine entrypoint public_rm() { cd ~/launchers || return + exec rm -vi -- "$@" } @@ -170,6 +177,7 @@ public_do() { # Expose SPICE via TCP public_spice() { export QEMUSH_NAME="$1" + if [ -n "$2" ]; then port=$2 else