-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
30 lines (23 loc) · 839 Bytes
/
entrypoint.sh
File metadata and controls
30 lines (23 loc) · 839 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
28
29
30
#!/bin/bash
set -e
DB_HOST_VALUE="${DB_HOST:-learnsite-db}"
DB_PASSWORD_VALUE="${DB_PASSWORD:-}"
escape_sed_replacement()
{
printf '%s' "$1" | sed 's/[\\&|]/\\&/g'
}
if [ ! -f "/app/web.config" ]; then
echo "Missing /app/web.config"
exit 1
fi
echo "Updating database connection in web.config..."
ESCAPED_HOST="$(escape_sed_replacement "$DB_HOST_VALUE")"
sed -i "s|__DB_HOST__|${ESCAPED_HOST}|g" /app/web.config
if [ -n "$DB_PASSWORD_VALUE" ]; then
ESCAPED_PASSWORD="$(escape_sed_replacement "$DB_PASSWORD_VALUE")"
sed -i "s|__DB_PASSWORD__|${ESCAPED_PASSWORD}|g" /app/web.config
fi
# ChatServer 已嵌入 ASP.NET 进程,由 Global.asax Application_Start 在端口 8188 启动
echo "ChatServer will start in-process with ASP.NET on port 8188"
echo "Starting XSP4..."
exec xsp4 --port 8080 --root /app --nonstop