49 lines
1012 B
Bash
Executable File
49 lines
1012 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# runs in container
|
|
|
|
# runs on host to start container
|
|
usage() {
|
|
echo -n "Usage: ${0}"
|
|
echo -n " [-c <config (/config/cvtt.cfg)>]"
|
|
echo -n " [-a <admin_port (7220)>]"
|
|
echo -n " [-z (compress log)"]
|
|
echo
|
|
exit 1
|
|
}
|
|
|
|
Config=/config/cvtt.cfg
|
|
AdminPort=7220
|
|
COMPRESS_LOG=false
|
|
|
|
|
|
while getopts "c:a:z" opt; do
|
|
case ${opt} in
|
|
c ) Config=$OPTARG ;;
|
|
a ) AdminPort=$OPTARG ;;
|
|
z ) COMPRESS_LOG=true ;;
|
|
\? )
|
|
echo "Invalid option: -$OPTARG" >&2
|
|
usage
|
|
;;
|
|
: )
|
|
echo "Option -$OPTARG requires an argument." >&2
|
|
usage
|
|
;;
|
|
esac
|
|
done
|
|
|
|
Cmd="python3.12"
|
|
Cmd="${Cmd} cvttpy/apps/microservices/market_gateways/order_entry_gateway.py"
|
|
Cmd="${Cmd} --config=${Config}"
|
|
Cmd="${Cmd} --credentials_file=/.creds"
|
|
Cmd="${Cmd} --admin_port=${AdminPort}"
|
|
Cmd="${Cmd} --log_file=/logs/%T.md_gateway.log"
|
|
if ${COMPRESS_LOG} ; then
|
|
Cmd="${Cmd} --compress_log"
|
|
fi
|
|
echo ${Cmd}
|
|
eval ${Cmd}
|
|
|
|
|