diff --git a/src/confd/bin/gen-interfaces b/src/confd/bin/gen-interfaces index 45e3b961..984f47ed 100755 --- a/src/confd/bin/gen-interfaces +++ b/src/confd/bin/gen-interfaces @@ -56,17 +56,26 @@ EOF exit 0 } +iftype() +{ + iftype=$(ip -d -j link show "$1" |jq -r .[].parentbus) + if [ "$iftype" = "virtio" ]; then + echo "infix-if-type:etherlike" + else + echo "infix-if-type:ethernet" + fi +} + # shellcheck disable=SC3043 gen_iface_json() { - local iftype="$1" - local ifname="$2" - local br="$3" + local ifname="$1" + local br="$2" cat <