option now need -- before to be called

This commit is contained in:
primardj 2024-02-01 14:36:55 +00:00
parent 9975745547
commit 9fd75c462d

View file

@ -4,7 +4,7 @@
#RESULT_POSSIBLE=("init","list","start","start_backup","create","backup","restore","suppr") #RESULT_POSSIBLE=("init","list","start","start_backup","create","backup","restore","suppr")
# Constante d'éxecutions. # Constante d'éxecutions.
Version="0.7.0-developpement_02-01-2021" Version="0.7.0"
USAGE="vm-start [PARAMETTER] [ NAME COMMAND [OPTION] ] USAGE="vm-start [PARAMETTER] [ NAME COMMAND [OPTION] ]
Script to manage virtual machine easily. Script to manage virtual machine easily.
@ -28,17 +28,17 @@ COMMAND available
OPTION available OPTION available
nproc=<nb proc> Def the number of proc of the vm --nproc=<nb proc> Def the number of proc of the vm
memory=<mem> Def the qty of memory allocated to the vm --memory=<mem> Def the qty of memory allocated to the vm
size=<size> Def the size that should be allocated by create #TODO --size=<size> Def the size that should be allocated by create #TODO
uefi Select if there will be an UEFI by default. --uefi Select if there will be an UEFI by default.
can be either set or unset. By default is unset. can be either set or unset. By default is unset.
options=<option> additinal options to give to qemu. By default is --options=<option> additinal options to give to qemu. By default is
-display gtk -vga qxl -display gtk -vga qxl
create_disk=<loc_disk> Def a create disk to boot on. Is necessary for using create, or need the variable INSTALLATION_DISK_LOCATION to be set. --create_disk=<loc_disk> Def a create disk to boot on. Is necessary for using create, or need the variable INSTALLATION_DISK_LOCATION to be set.
net=nat:id Add a nat connection to the vm. By default there is already one. --net=nat:id Add a nat connection to the vm. By default there is already one.
net=br:<br-id> Connect the vm to the bridge <br-id>. Please use the script set-tap.sh as root to create the bridge. in the conf file, a mac field have to be set. for two vm to connect togethers, their mac addresses on the same network have to be differents. --net=br:<br-id> Connect the vm to the bridge <br-id>. Please use the script set-tap.sh as root to create the bridge. in the conf file, a mac field have to be set. for two vm to connect togethers, their mac addresses on the same network have to be differents.
net=none The vm will have no network interface --net=none The vm will have no network interface
" "
MAIN_LOCATION="$HOME/virtual_machine" MAIN_LOCATION="$HOME/virtual_machine"
@ -297,22 +297,22 @@ fi
for (( i=3; i<=$#; i++)); do for (( i=3; i<=$#; i++)); do
case "${!i%=*}" in case "${!i%=*}" in
"nproc") "--nproc")
NPROC="${!i#*=}" NPROC="${!i#*=}"
;; ;;
"memory") "--memory")
MEMORY="${!i#*=}" MEMORY="${!i#*=}"
;; ;;
"size") "--size")
SIZE="${!i#*=}" SIZE="${!i#*=}"
;; ;;
"uefi") "--uefi")
set_uefi set_uefi
;; ;;
"create_disk") "--create_disk")
INSTALLATION_DISK_LOCATION="${!i#*=}" INSTALLATION_DISK_LOCATION="${!i#*=}"
;; ;;
"net") "--net")
param="${!i#*=}" param="${!i#*=}"
set_net "${param}" set_net "${param}"
;; ;;