-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·56 lines (51 loc) · 1.31 KB
/
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
#!/bin/bash
SS_CONFIG=${SS_CONFIG:-""}
SS_MODULE=${SS_MODULE:-"ss-server"}
KCP_CONFIG=${KCP_CONFIG:-""}
KCP_MODULE=${KCP_MODULE:-"kcpserver"}
KCP_FLAG=${KCP_FLAG:-"false"}
P_PAC_FLAG=${P_PAC_FLAG:-""}
P_SS_FLAG=${P_SS_FLAG:-""}
P_LOCAL_FLAG=${P_LOCAL_FLAG:-""}
P_SOCKS_PROXY=${P_SOCKS_PROXY:-""}
while getopts "s:m:k:e:x:p:q:r:t:u:v" OPT; do
case $OPT in
s)
SS_CONFIG=$OPTARG;;
m)
SS_MODULE=$OPTARG;;
k)
KCP_CONFIG=$OPTARG;;
e)
KCP_MODULE=$OPTARG;;
x)
KCP_FLAG=$OPTARG;;
p)
P_PAC_FLAG=$OPTARG;;
r)
P_SS_FLAG=$OPTARG;;
u)
P_LOCAL_FLAG=$OPTARG;;
v)
P_SOCKS_PROXY=$OPTARG;;
esac
done
export SS_CONFIG=${SS_CONFIG}
export SS_MODULE=${SS_MODULE}
export KCP_CONFIG=${KCP_CONFIG}
export KCP_MODULE=${KCP_MODULE}
export KCP_FLAG=${KCP_FLAG}
export P_PAC_FLAG=${P_PAC_FLAG}
export P_SS_FLAG=${P_SS_FLAG}
export P_LOCAL_FLAG=${P_LOCAL_FLAG}
export P_SOCKS_PROXY=${P_SOCKS_PROXY}
echo ${SS_CONFIG} >> a.txt
echo ${SS_MODULE} >> a.txt
echo ${KCP_CONFIG} >> a.txt
echo ${KCP_MODULE} >> a.txt
echo ${KCP_FLAG} >> a.txt
echo ${P_PAC_FLAG} >> a.txt
echo ${P_SS_FLAG} >> a.txt
echo ${P_LOCAL_FLAG} >> a.txt
echo ${P_SOCKS_PROXY} >> a.txt
exec runsvdir -P /etc/service