From 2010c3850b0a0c0b6e0f84694e9bc6938f6c4d32 Mon Sep 17 00:00:00 2001 From: Nicolas MORIN Date: Wed, 7 Feb 2024 17:17:48 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20du=20code=20g=C3=A9rant=20l'option=20pa?= =?UTF-8?q?rametres=20en=20champ=20libre=20+=20cr=C3=A9ation=20d'une=20var?= =?UTF-8?q?iable=20avec=20le=20nom=20du=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qemu-adm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/qemu-adm b/qemu-adm index cb74cb6..09258ed 100755 --- a/qemu-adm +++ b/qemu-adm @@ -3,6 +3,7 @@ base_chemin_mv="/tmp/ramdisk/qemu-adm" bin_qemu="/usr/bin/qemu-system-x86_64" bin_qemu_img="/usr/bin/qemu-img" +nom_script=$(basename $0) die() { @@ -68,6 +69,9 @@ nouvMV() echo "-device ${2},netdev=${1} -netdev tap,id=${1},ifname=${1},script=no,downscript=no \\" >> ${chemin_mv} ;; + "parametres") + echo "$@ \\" >> ${chemin_mv} + ;; esac } @@ -338,13 +342,6 @@ creeMV() commandes_a_executer+=( "nouvMV reseau ${reseau_nom_interface} ${reseau_type} ${reseau_activ_pont} ${reseau_nom_pont} ${reseau_activ_8021q} ${reseau_mode_8021q} ${reseau_vid}") echo "nouvMV reseau ${reseau_nom_interface} ${reseau_type} ${reseau_activ_pont} ${reseau_nom_pont} ${reseau_activ_8021q} ${reseau_mode_8021q} ${reseau_vid}" # Debogage - ;; - '-p') # Parametres - echo "parametres" # Debogage - parametre="${2}" - presenceParametre "$#" "$1" - echo "parametres parametre=${parametre}" # Debogage - shift ;; "-s") # Sous-volume BTRFS echo "sous-volume" # Debogage @@ -369,6 +366,15 @@ creeMV() usage "cree" exit 0 ;; + '--') # Autre parametres (champ libre) + echo "parametres" # Debogage + presenceParametre "$#" "$1" + shift + parametres="$@" + echo "parametres=${parametres}" # Debogage + commandes_a_executer+=( "nouvMV parametres $parametres") + shift $# + ;; *) # Autre usage "cree" ;;