subweb/start.sh

24 lines
733 B
Bash
Raw Normal View History

2022-07-10 20:33:00 +08:00
#/bin/sh
2022-07-11 16:17:01 +08:00
if [ ! -f /usr/share/nginx/html/conf/config.js ]; then
cp /app/public/conf/config.js /usr/share/nginx/html/conf
fi
2022-07-10 20:33:00 +08:00
if [ $API_URL ]; then
echo "当前 API 地址为: $API_URL"
2022-07-11 16:17:01 +08:00
sed -i "s#http://127.0.0.1:25500#$API_URL#g" /usr/share/nginx/html/conf/config.js
2022-07-10 20:33:00 +08:00
else
echo "当前为默认本地 API 地址: http://127.0.0.1:25500"
echo "如需修改请在容器启动时使用 -e API_URL='https://sub.ops.ci' 传递环境变量"
fi
2022-08-05 13:51:40 +08:00
if [ $SHORT_URL ]; then
2024-02-07 13:24:59 +08:00
echo "当前短链接地址为: $SHORT_URL"
2022-08-05 13:51:40 +08:00
sed -i "s#https://s.ops.ci#$SHORT_URL#g" /usr/share/nginx/html/conf/config.js
fi
2022-07-11 16:17:01 +08:00
if [ $SITE_NAME ]; then
sed -i "s#Subconverter Web#$SITE_NAME#g" /usr/share/nginx/html/conf/config.js
fi
2022-07-10 20:33:00 +08:00
nginx -g "daemon off;"