change an if elif elif elif else by a case

This commit is contained in:
primardj 2024-01-23 20:26:08 +00:00
parent 4a7ab2b52e
commit 6c1dadb06b

View file

@ -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