diff --git a/vm-start.sh b/vm-start.sh index d9c5b58..b429e21 100755 --- a/vm-start.sh +++ b/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 - NPROC="${!i#*=}" - elif [ "${!i%=*}" == "memory" ] - then - MEMORY="${!i#*=}" - elif [ "${!i%=*}" == "uefi" ] - then - 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 + case "${!i%=*}" in + "nproc") + NPROC="${!i#*=}" + ;; + "memory") + MEMORY="${!i#*=}" + ;; + "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" + ;; + esac done