aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/scripts/lib.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/scripts/lib.sh')
-rw-r--r--mcp/scripts/lib.sh11
1 files changed, 3 insertions, 8 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
index 650c63b16..fcc5d76ac 100644
--- a/mcp/scripts/lib.sh
+++ b/mcp/scripts/lib.sh
@@ -72,7 +72,7 @@ create_networks() {
virsh net-undefine "${net}"
fi
# in case of custom network, host should already have the bridge in place
- if [ -f "net_${net}.xml" ]; then
+ if [ -f "net_${net}.xml" ] && [ ! -d "/sys/class/net/${net}/bridge" ]; then
virsh net-define "net_${net}.xml"
virsh net-autostart "${net}"
virsh net-start "${net}"
@@ -103,12 +103,7 @@ create_vms() {
vnode_networks[2]="${vnode_networks[0]}"
fi
for net in "${vnode_networks[@]:1}"; do
- net_type="network"
- # in case of custom network, host should already have the bridge in place
- if [ ! -f "net_${net}.xml" ]; then
- net_type="bridge"
- fi
- net_args="${net_args} --network ${net_type}=${net},model=virtio"
+ net_args="${net_args} --network bridge=${net},model=virtio"
done
# shellcheck disable=SC2086
@@ -176,7 +171,7 @@ parse_yaml() {
s='[[:space:]]*'
w='[a-zA-Z0-9_]*'
fs="$(echo @|tr @ '\034')"
- sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
+ sed -e 's|---||g' -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s[:-]$s\(.*\)$s\$|\1$fs\2$fs\3|p" "$1" |
awk -F"$fs" '{
indent = length($1)/2;