Debian Codegraph @

docker/entrypoint-stream.sh

raw
1 #!/bin/bash
2
3 set -eo pipefail
4
5 socket_port=""
6
7 # Parse command line arguments
8 while [[ $# -gt 0 ]]; do
9 key="$1"
10 case $key in
11 --socket-port)
12 socket_port="$2"
13 shift
14 shift
15 ;;
16 *)
17 echo "Unknown option $key"
18 exit 1
19 ;;
20 esac
21 done
22
23 # enable conda for this shell
24 # shellcheck disable=SC1091
25 . /opt/conda/etc/profile.d/conda.sh
26
27 # activate the environment
28 conda activate ismrmrd
29
30 if [ -z "$socket_port" ]; then
31 exec ismrmrd_stream_recon_cartesian_2d --use-stdin --use-stdout
32 else
33 exec socat TCP4-LISTEN:$socket_port,fork,reuseaddr "EXEC:ismrmrd_stream_recon_cartesian_2d --use-stdin --use-stdout"
34 fi