Skip to content

Commit

Permalink
Merge pull request #40 from musk-1024/main
Browse files Browse the repository at this point in the history
Fix two issue for lacking the environment "SHORT_URL"
  • Loading branch information
stilleshan authored Jul 4, 2024
2 parents 2717be9 + 3c7cfe4 commit 671d175
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sub/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ else
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
Expand Down
5 changes: 5 additions & 0 deletions subweb/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ else
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
Expand Down

0 comments on commit 671d175

Please sign in to comment.