-
Notifications
You must be signed in to change notification settings - Fork 266
/
entrypoint.sh
executable file
·63 lines (51 loc) · 954 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
parameter=""
if [ ! -z "$THREADS" ]
then
parameter="$parameter --threads $THREADS"
fi
if [ ! -z "$DISABLE_NODELAY" ]
then
parameter="$parameter --disable-nodelay"
fi
if [ ! -z "$V3" ]
then
parameter="$parameter --v3"
fi
if [ ! -z "$STRICT" ]
then
parameter="$parameter --strict"
fi
if [ "$MODE" = "server" ]
then
parameter="$parameter $MODE"
if [ ! -z "$TLS" ]
then
parameter="$parameter --tls $TLS"
fi
fi
if [ "$MODE" = "client" ]
then
parameter="$parameter $MODE"
if [ ! -z "$TLS" ]
then
parameter="$parameter --sni $TLS"
fi
if [ ! -z "$ALPN" ]
then
parameter="$parameter --alpn $ALPN"
fi
fi
if [ ! -z "$SERVER" ]
then
parameter="$parameter --server $SERVER"
fi
if [ ! -z "$LISTEN" ]
then
parameter="$parameter --listen $LISTEN"
fi
if [ ! -z "$PASSWORD" ]
then
parameter="$parameter --password $PASSWORD"
fi
exec shadow-tls $parameter