forked from stilleshan/subweb
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·27 lines (23 loc) · 917 Bytes
/
start.sh
File metadata and controls
executable file
·27 lines (23 loc) · 917 Bytes
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
#/bin/sh
if [ ! -f /usr/share/nginx/html/conf/config.js ]; then
if [ -f /app/public/conf/config_static.js ]; then
cp /app/public/conf/config_static.js /usr/share/nginx/html/conf/config.js
elif [ -f /app/public/conf/config.js ]; then
cp /app/public/conf/config.js /usr/share/nginx/html/conf
fi
fi
if [ $API_URL ]; then
echo "当前 API 地址为: $API_URL"
sed -i "s#http://127.0.0.1:25500#$API_URL#g" /usr/share/nginx/html/conf/config.js
else
echo "当前为默认本地 API 地址: http://127.0.0.1:25500"
echo "如需修改请在容器启动时使用 -e API_URL='https://sub.ops.ci' 传递环境变量"
fi
if [ $SHORT_URL ]; then
echo "当前短链接地址为: $SHORT_URL"
sed -i "s#https://s.ops.ci#$SHORT_URL#g" /usr/share/nginx/html/conf/config.js
fi
if [ $SITE_NAME ]; then
sed -i "s#Subconverter Web#$SITE_NAME#g" /usr/share/nginx/html/conf/config.js
fi
nginx -g "daemon off;"