change an if elif elif elif else by a case
This commit is contained in:
parent
4a7ab2b52e
commit
6c1dadb06b
1 changed files with 14 additions and 15 deletions
17
vm-start.sh
17
vm-start.sh
|
@ -63,8 +63,6 @@ INIT() {
|
|||
if [[ "$entry" =~ ^[yY]$ ]]
|
||||
then
|
||||
FORWARD=",hostfwd=tcp::10022-:22" # forward VM 22 port to Host 10022
|
||||
else
|
||||
FORWARD=""
|
||||
fi
|
||||
|
||||
mkdir -p conf
|
||||
|
@ -216,19 +214,20 @@ fi
|
|||
. "conf/$1-vm_var.sh"
|
||||
|
||||
for (( i=3; i<=$#; i++)); do
|
||||
if [ "${!i%=*}" == "nproc" ]
|
||||
then
|
||||
case "${!i%=*}" in
|
||||
"nproc")
|
||||
NPROC="${!i#*=}"
|
||||
elif [ "${!i%=*}" == "memory" ]
|
||||
then
|
||||
;;
|
||||
"memory")
|
||||
MEMORY="${!i#*=}"
|
||||
elif [ "${!i%=*}" == "uefi" ]
|
||||
then
|
||||
;;
|
||||
"uefi")
|
||||
UEFI="set"
|
||||
OPTION="$OPTION \
|
||||
-drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2/x64/OVMF_CODE.4m.fd \
|
||||
-drive if=pflash,format=raw,file=${MAIN_LOCATION}/${LOCATION}/OVMF_VARS.4m.fd"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue