#!/bin/bash
echo 'Interface by UCRV kvm'
set -e -u

tmp=$(mktemp -d)
trap "rm -rf '$tmp'" EXIT

export UNIVENTION_BASECONF="$tmp/base.conf"
cat <<'__UCR__' >"$UNIVENTION_BASECONF"
# univention_ base.conf

uvmm/kvm/bridge/interface: eth42
interfaces/eth42/type: dynamic
__UCR__

mkdir -p "$tmp/eth42"
"$(dirname "$0")/../ucs-kvm-setup-bridge" --dry-run --sys-root "$tmp" >"$tmp/out"

diff -u "$tmp/out" - <<'__OUT__'
interfaces/br0/options/0: 'bridge_fd 0'
interfaces/br0/options/1: 'bridge_ports eth42'
interfaces/br0/type: 'dynamic'
interfaces/eth42/start: 'true'
interfaces/eth42/type: 'manual'
__OUT__
