20 lines
481 B
Bash
20 lines
481 B
Bash
#!/bin/sh
|
|
|
|
set -o errexit
|
|
|
|
if [ "$1" = "/usr/bin/ss-server" ]; then
|
|
if [ -f "$PASSWORD_FILE" ]; then
|
|
PASSWORD="$(cat "$PASSWORD_FILE")"
|
|
fi
|
|
|
|
if [[ -f "/var/run/secrets/$PASSWORD_SECRET" ]]; then
|
|
PASSWORD=$(cat "/var/run/secrets/$PASSWORD_SECRET")
|
|
fi
|
|
|
|
ARGS="-s $SERVER_HOST -p $SERVER_PORT -k ${PASSWORD:-$(hostname)} \
|
|
-m $METHOD -t $TIMEOUT -u $DNS --fast-open --reuse-port --plugin $PLUGIN \
|
|
--plugin-opts $PLUGIN_OPTS $ARGS"
|
|
fi
|
|
|
|
exec $@ $ARGS
|