Cleanup
[carla.git] / data / carla-osc-gui
blob5a1f2871cc1a071f76bd0e0a546f1bdb49412859
1 #!/bin/sh
3 set -e
5 PYTHON=$(which python3 2>/dev/null)
7 if [ ! -f ${PYTHON} ]; then
8 PYTHON=python
9 fi
11 if [ "$1" = "--gdb" ]; then
12 PYTHON="gdb --args $PYTHON"
15 INSTALL_ARGS="--with-appname="${0}""
17 if [ -f "$(dirname ${0})/carla-utils.pc" ]; then
18 cd "$(dirname ${0})/.."
19 INSTALL_PREFIX="$(pwd)"
20 INSTALL_FRONTENDDIR="${INSTALL_PREFIX}/source/frontend"
21 else
22 INSTALL_PREFIX="X-PREFIX-X"
23 INSTALL_FRONTENDDIR="${INSTALL_PREFIX}/share/carla"
24 INSTALL_ARGS="${INSTALL_ARGS} --with-libprefix="${INSTALL_PREFIX}""
27 if lsof -i:21337 > /dev/null; then
28 echo "NOTICE: Backend already running"
29 else
30 ${PYTHON} "${INSTALL_FRONTENDDIR}/carla" ${INSTALL_ARGS} --osc-gui=21337 "$@" --with-appname="carla-osc-dsp"
31 echo "NOTICE: Backend was not running yet, start was triggered now"
34 exec ${PYTHON} "${INSTALL_FRONTENDDIR}/carla-control" ${INSTALL_ARGS} osc.tcp://127.0.0.1:21337/Carla "$@"