add possiblity to set network in config file
This commit is contained in:
parent
716d7e8752
commit
f55f2f1639
1 changed files with 5 additions and 2 deletions
|
@ -215,13 +215,11 @@ set_uefi() {
|
||||||
set_net() {
|
set_net() {
|
||||||
case "${1%:*}" in
|
case "${1%:*}" in
|
||||||
"nat")
|
"nat")
|
||||||
echo "add the interface ${1#*:}"
|
|
||||||
network="${network} \
|
network="${network} \
|
||||||
-netdev user,id=${1#*:} \
|
-netdev user,id=${1#*:} \
|
||||||
-device virtio-net,netdev=${1#*:}"
|
-device virtio-net,netdev=${1#*:}"
|
||||||
;;
|
;;
|
||||||
"br")
|
"br")
|
||||||
echo "add bridge ${1#*:}"
|
|
||||||
if [ "${mac}" == "" ]
|
if [ "${mac}" == "" ]
|
||||||
then
|
then
|
||||||
echo "error, no mac set"
|
echo "error, no mac set"
|
||||||
|
@ -295,6 +293,11 @@ fi
|
||||||
|
|
||||||
. "conf/$1-vm_var.sh"
|
. "conf/$1-vm_var.sh"
|
||||||
|
|
||||||
|
for i in ${net}; do
|
||||||
|
set_net "${i}"
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
for (( i=3; i<=$#; i++)); do
|
for (( i=3; i<=$#; i++)); do
|
||||||
case "${!i%=*}" in
|
case "${!i%=*}" in
|
||||||
"--nproc")
|
"--nproc")
|
||||||
|
|
Loading…
Reference in a new issue