aboutsummaryrefslogtreecommitdiffstats
path: root/release/docker/docker-entrypoint.sh
blob: 84ea81e6a99ce36f0e6f44387689735071360775 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
# WARNING: do not change the shebang - the Docker base image might not have what you want!

set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace

MITMPROXY_PATH="/home/mitmproxy/.mitmproxy"

if [[ "$1" = "mitmdump" || "$1" = "mitmproxy" || "$1" = "mitmweb" ]]; then
  mkdir -p "$MITMPROXY_PATH"
  chown -R mitmproxy:mitmproxy "$MITMPROXY_PATH"
  su-exec mitmproxy "$@"
else
  exec "$@"
fi