2020-04-13 10:20:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# WARNING: do not change the shebang - the Docker base image might not have what you want!
|
2020-04-11 10:25:56 +00:00
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
|
|
|
set -o nounset
|
|
|
|
# set -o xtrace
|
2018-05-18 08:37:56 +00:00
|
|
|
|
|
|
|
MITMPROXY_PATH="/home/mitmproxy/.mitmproxy"
|
|
|
|
|
|
|
|
if [[ "$1" = "mitmdump" || "$1" = "mitmproxy" || "$1" = "mitmweb" ]]; then
|
2020-04-11 10:25:56 +00:00
|
|
|
mkdir -p "$MITMPROXY_PATH"
|
|
|
|
chown -R mitmproxy:mitmproxy "$MITMPROXY_PATH"
|
|
|
|
su-exec mitmproxy "$@"
|
2018-05-18 08:37:56 +00:00
|
|
|
else
|
2020-04-11 10:25:56 +00:00
|
|
|
exec "$@"
|
2018-05-18 08:37:56 +00:00
|
|
|
fi
|