#!/bin/bash

pickup_defaults
init_netprofile
pickup_options

[ -x "${BRCTL:=$DEFAULT_BRCTL}" ] || {
	print_error "$BRCTL does not exist or is not executable. Try installing bridge-utils RPM."
	exit 1
}

for host in $HOST; do
	$BRCTL addif $NAME $host
done

if profiled_filename PROF_BRCTL "$MYIFACEDIR/brctl"; then
	$DENOISE $PROF_BRCTL |
		trim |
		sed "s/ AUTO / $NAME /" |
		xargs --max-lines=1 $BRCTL
fi && print_progress
