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]$ ]]
|
if [[ "$entry" =~ ^[yY]$ ]]
|
||||||
then
|
then
|
||||||
FORWARD=",hostfwd=tcp::10022-:22" # forward VM 22 port to Host 10022
|
FORWARD=",hostfwd=tcp::10022-:22" # forward VM 22 port to Host 10022
|
||||||
else
|
|
||||||
FORWARD=""
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p conf
|
mkdir -p conf
|
||||||
|
@ -216,19 +214,20 @@ fi
|
||||||
. "conf/$1-vm_var.sh"
|
. "conf/$1-vm_var.sh"
|
||||||
|
|
||||||
for (( i=3; i<=$#; i++)); do
|
for (( i=3; i<=$#; i++)); do
|
||||||
if [ "${!i%=*}" == "nproc" ]
|
case "${!i%=*}" in
|
||||||
then
|
"nproc")
|
||||||
NPROC="${!i#*=}"
|
NPROC="${!i#*=}"
|
||||||
elif [ "${!i%=*}" == "memory" ]
|
;;
|
||||||
then
|
"memory")
|
||||||
MEMORY="${!i#*=}"
|
MEMORY="${!i#*=}"
|
||||||
elif [ "${!i%=*}" == "uefi" ]
|
;;
|
||||||
then
|
"uefi")
|
||||||
UEFI="set"
|
UEFI="set"
|
||||||
OPTION="$OPTION \
|
OPTION="$OPTION \
|
||||||
-drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2/x64/OVMF_CODE.4m.fd \
|
-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"
|
-drive if=pflash,format=raw,file=${MAIN_LOCATION}/${LOCATION}/OVMF_VARS.4m.fd"
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue