-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·34 lines (26 loc) · 1.08 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
#!/bin/bash
echo ${PASSWORD}
export PASSWORD_JSON="$(echo -n "$PASSWORD" | jq -Rc)"
echo ${V2_Path}
echo ${QR_Path}
bash /conf/shadowsocks-libev_config.json > /etc/shadowsocks-libev/config.json
echo /etc/shadowsocks-libev/config.json
cat /etc/shadowsocks-libev/config.json
bash /conf/nginx_ss.conf > /etc/nginx/conf.d/ss.conf
echo /etc/nginx/conf.d/ss.conf
cat /etc/nginx/conf.d/ss.conf
if [ "$DOMAIN" = "no" ]; then
echo "Do not generate QR-code"
else
[ ! -d /wwwroot/${QR_Path} ] && mkdir /wwwroot/${QR_Path}
plugin=$(echo -n "v2ray;path=/${V2_Path};host=${DOMAIN};tls" | sed -e 's/\//%2F/g' -e 's/=/%3D/g' -e 's/;/%3B/g')
ss="ss://$(echo -n ${ENCRYPT}:${PASSWORD} | base64 -w 0)@${DOMAIN}:443?plugin=${plugin}"
echo "${ss}" | tr -d '\n' > /wwwroot/${QR_Path}/index.html
echo -n "${ss}" | qrencode -s 6 -o /wwwroot/${QR_Path}/vpn.png
fi
bash /conf/connect.json > /wwwroot${QR_Path}/connect.json
echo /wwwroot${QR_Path}/connect.json
cat /wwwroot${QR_Path}/connect.json
ss-server -c /etc/shadowsocks-libev/config.json &
rm -rf /etc/nginx/sites-enabled/default
nginx -g 'daemon off;'