-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathentrypoint.sh
59 lines (52 loc) · 1.28 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
57
58
59
cd /v2raybin
if [ "${CONFIG_URL}" ]
then
curl -L -o config.json "${CONFIG_URL}"
sed -i "s/${OID}/${UUID}/g" config.json
else
echo -e -n "$CONFIG_JSON1" > config.json
echo -e -n "$UUID" >> config.json
echo -e -n "$CONFIG_JSON2" >> config.json
fi
if [ "${SS_PASS}" ]
then
PARAM_SS_PASS=${SS_PASS}
else
PARAM_SS_PASS=yhiblog
fi
if [ "${FRP_OLD}" ]
then
PARAM_FRP_OLD=${FRP_OLD}
else
PARAM_FRP_OLD="test.com"
fi
if [ "${FRP_URL}" ]
then
PARAM_FRP_URL=${FRP_URL}
else
PARAM_FRP_URL="https://github.com/fatedier/frp/releases/download/v0.14.1/frp_0.14.1_linux_amd64.tar.gz"
fi
if [ "${FRP_CONFIG}" ]
then
PARAM_FRP_CONFIG=${FRP_CONFIG}
else
PARAM_FRP_CONFIG="https://raw.githubusercontent.com/yulahuyed/v2ray/master/frpc.ini"
fi
if [ "${FRP_NEW}" ]
then
curl -L -o frp.tar.gz "${PARAM_FRP_URL}"
tar -xvzf frp.tar.gz
mv ./frp*/frpc ./
chmod +x frpc
rm -rf frp_*
rm frp.tar.gz
curl -L -o frpc.ini "${PARAM_FRP_CONFIG}"
sed -i "s/${PARAM_FRP_OLD}/${FRP_NEW}/g" frpc.ini
nohup ./frpc -c ./frpc.ini >/dev/null 2>&1 &
nohup ./shadowsocks-server -p 3600 -k ${PARAM_SS_PASS} -m aes-256-cfb >/dev/null 2>&1 &
fi
if [ "$CERT_PEM" != "$KEY_PEM" ]; then
echo -e "$CERT_PEM" > cert.pem
echo -e "$KEY_PEM" > key.pem
fi
./v2ray