dumbproxy/entrypoint.sh

22 lines
609 B
Bash
Raw Normal View History

2022-12-27 21:57:50 +03:00
#!/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