Files
HubBackendDocker/docker/entrypoint.sh
T

29 lines
693 B
Bash
Executable File

#!/bin/sh
# Start a compiled program.
set -eu
if [ "$(id -u)" = "0" ] && [ -d /app/config ]; then
chown -R drivershub:drivershub /app/config
fi
if [ "${TRUST_HOST_PROXY:-0}" = "1" ]; then
proxy_ip="$(ip -4 route show default | sed -n 's/^default via \([^ ]*\).*/\1/p' | head -n 1)"
if [ -z "$proxy_ip" ]; then
echo "Cannot determine the trusted Docker network gateway." >&2
exit 1
fi
export FORWARDED_ALLOW_IPS="127.0.0.1,$proxy_ip"
fi
if [ "${1:-}" = "drivershub" ]; then
shift
exec gosu drivershub /app/drivershub "$@"
fi
if [ "${1:-}" = "bannergen" ]; then
shift
exec gosu drivershub /app/bannergen "$@"
fi
exec gosu drivershub "$@"