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")
# Constante d'éxecutions.
Version="0.7.0-developpement_02-01-2021"
Version="0.7.0"
USAGE="vm-start [PARAMETTER] [ NAME COMMAND [OPTION] ]
Script to manage virtual machine easily.
@ -28,17 +28,17 @@ COMMAND available
OPTION available
nproc=<nb proc> Def the number of proc of 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
uefi Select if there will be an UEFI by default.
--nproc=<nb proc> Def the number of proc of 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
--uefi Select if there will be an UEFI by default.
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
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=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
--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=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
"
MAIN_LOCATION="$HOME/virtual_machine"
@ -297,22 +297,22 @@ fi
for (( i=3; i<=$#; i++)); do
case "${!i%=*}" in
"nproc")
"--nproc")
NPROC="${!i#*=}"
;;
"memory")
"--memory")
MEMORY="${!i#*=}"
;;
"size")
"--size")
SIZE="${!i#*=}"
;;
"uefi")
"--uefi")
set_uefi
;;
"create_disk")
"--create_disk")
INSTALLATION_DISK_LOCATION="${!i#*=}"
;;
"net")
"--net")
param="${!i#*=}"
set_net "${param}"
;;