-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·18 lines (16 loc) · 992 Bytes
/
docker-entrypoint.sh
File metadata and controls
executable file
·18 lines (16 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
# check if the `server.xml` file has been changed since the creation of this
# Docker image. If the file has been changed the entrypoint script will not
# perform modifications to the configuration file.
if [ "$(stat -c "%Y" "${CROWD_INSTALL}/apache-tomcat/conf/server.xml")" -eq "0" ]; then
if [ -n "${X_PROXY_NAME}" ]; then
xmlstarlet ed --inplace --pf --ps --insert '//Connector[@port="8095"]' --type "attr" --name "proxyName" --value "${X_PROXY_NAME}" "${CROWD_INSTALL}/apache-tomcat/conf/server.xml"
fi
if [ -n "${X_PROXY_PORT}" ]; then
xmlstarlet ed --inplace --pf --ps --insert '//Connector[@port="8095"]' --type "attr" --name "proxyPort" --value "${X_PROXY_PORT}" "${CROWD_INSTALL}/apache-tomcat/conf/server.xml"
fi
if [ -n "${X_PROXY_SCHEME}" ]; then
xmlstarlet ed --inplace --pf --ps --insert '//Connector[@port="8095"]' --type "attr" --name "scheme" --value "${X_PROXY_SCHEME}" "${CROWD_INSTALL}/apache-tomcat/conf/server.xml"
fi
fi
exec "$@"