#!/bin/bash

program_path="$0"

bindirname=`dirname $program_path`
basedirname=$(cd "$bindirname/..";pwd)

export LD_LIBRARY_PATH="$basedirname/lib/mysql-workbench:$LD_LIBRARY_PATH"

export MWB_DATA_DIR="$basedirname/share/mysql-workbench"
export MWB_MODULE_DIR="$basedirname/lib/mysql-workbench/modules"
export MWB_LIBRARY_DIR="$basedirname/lib/mysql-workbench/libraries"
export MWB_PLUGIN_DIR="$basedirname/lib/mysql-workbench/plugins"

export DBC_DRIVER_PATH="$basedirname/lib/mysql-workbench"

if type -p catchsegv > /dev/null; then
catchsegv $bindirname/mysql-workbench-bin $*
else
$bindirname/mysql-workbench-bin $*
fi
