+ shift 3
+ while [ $# -ne 0 ]; do
+ case $1 in
+ --ipaddress=*)
+ ADDRESS=`expr X"$1" : 'X[^=]*=\(.*\)'`
+ shift
+ ;;
+ --macaddress=*)
+ MACADDRESS=`expr X"$1" : 'X[^=]*=\(.*\)'`
+ shift
+ ;;
+ --gateway=*)
+ GATEWAY=`expr X"$1" : 'X[^=]*=\(.*\)'`
+ shift
+ ;;
+ --mtu=*)
+ MTU=`expr X"$1" : 'X[^=]*=\(.*\)'`
+ shift
+ ;;
+ *)
+ echo >&2 "$UTIL add-port: unknown option \"$1\""
+ exit 1
+ ;;
+ esac
+ done
+
+ # Check if a port is already attached for the given container and interface
+ PORT=`get_port_for_container_interface "$CONTAINER" "$INTERFACE" \
+ 2>/dev/null`
+ if [ -n "$PORT" ]; then
+ echo >&2 "$UTIL: Port already attached" \
+ "for CONTAINER=$CONTAINER and INTERFACE=$INTERFACE"
+ exit 1
+ fi
+
+ if ovs_vsctl br-exists "$BRIDGE" || \
+ ovs_vsctl add-br "$BRIDGE"; then :; else