You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openvibe-external-application-launcher-base 933B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. #
  3. # This script is meant to be launched from inside an OpenViBE application (such as a scenario in Designer)
  4. #
  5. CALLCMD=$1
  6. shift
  7. ov_run_bg=0
  8. if [ "$1" == "--run-bg" ]; then
  9. ov_run_bg=1
  10. shift
  11. fi
  12. if [ "$OV_PATH_ROOT" == "" ]; then
  13. SOURCE="${BASH_SOURCE[0]}"
  14. while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  15. OV_PATH_ROOT="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  16. SOURCE="$(readlink "$SOURCE")"
  17. [[ $SOURCE != /* ]] && SOURCE="$OV_PATH_ROOT/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
  18. done
  19. OV_PATH_ROOT="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  20. fi
  21. if [ "$OV_PATH_BIN" == "" ]; then
  22. OV_PATH_BIN="$OV_PATH_ROOT/bin"
  23. fi
  24. ret_code=0
  25. if [ $ov_run_bg == 0 ]; then
  26. eval "$OV_PATH_BIN/$CALLCMD" @OV_CMD_ARGS@ $*
  27. ret_code=$?
  28. else
  29. "$OV_PATH_BIN/$CALLCMD" @OV_CMD_ARGS@ $* &
  30. fi
  31. exit $ret_code