add possiblity to set network in config file

This commit is contained in:
primardj 2024-02-05 00:22:52 +00:00
parent 716d7e8752
commit f55f2f1639

View file

@ -215,13 +215,11 @@ set_uefi() {
set_net() {
case "${1%:*}" in
"nat")
echo "add the interface ${1#*:}"
network="${network} \
-netdev user,id=${1#*:} \
-device virtio-net,netdev=${1#*:}"
;;
"br")
echo "add bridge ${1#*:}"
if [ "${mac}" == "" ]
then
echo "error, no mac set"
@ -295,6 +293,11 @@ fi
. "conf/$1-vm_var.sh"
for i in ${net}; do
set_net "${i}"
done
for (( i=3; i<=$#; i++)); do
case "${!i%=*}" in
"--nproc")