This repository has been archived on 2024-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
dumbproxy/entrypoint.sh
2022-12-27 21:57:50 +03:00

22 lines
609 B
Bash

#!/bin/sh
set -o errexit
if [ "$1" = "/usr/bin/dumbproxy" ]; then
if [ -n "$AUTH" ]; then
ARGS="-bind-address $ADDRESS -auth $AUTH $OPTIONS"
elif [ -n "$USERNAME" ] && [ -n "$PASSWORD" ]; then
if [ -n "$HIDDEN_DOMAIN" ]; then
AUTH="static://?username=$USERNAME&password=$PASSWORD&hidden_domain=$HIDDEN_DOMAIN"
else
AUTH="static://?username=$USERNAME&password=$PASSWORD"
fi
ARGS="-bind-address $ADDRESS -auth $AUTH $OPTIONS"
else
ARGS="-bind-address $ADDRESS $OPTIONS"
fi
fi
# shellcheck disable=SC2086
exec "$@" $ARGS