cryptpad/container-start.sh

24 lines
803 B
Bash
Raw Normal View History

2017-04-09 09:36:33 +00:00
#!/bin/sh
2016-12-29 21:02:03 +00:00
# Creating customize folder
mkdir -p customize
2017-04-09 09:36:33 +00:00
[ -z "$(ls -A customize)" ] && echo "Creating customize folder" \
2016-12-29 21:02:03 +00:00
&& cp -R customize.dist/* customize/ \
&& cp config.js.dist customize/config.js
# Linking config.js
2017-04-09 09:36:33 +00:00
[ ! -h config.js ] && echo "Linking config.js" && ln -s customize/config.js config.js
2016-12-29 21:02:03 +00:00
# Configure
2017-04-09 09:36:33 +00:00
[ -n "$USE_SSL" ] && echo "Using secure websockets: $USE_SSL" \
2016-12-29 21:02:03 +00:00
&& sed -i "s/useSecureWebsockets: .*/useSecureWebsockets: ${USE_SSL},/g" customize/config.js
2017-04-09 09:36:33 +00:00
[ -n "$STORAGE" ] && echo "Using storage adapter: $STORAGE" \
2016-12-29 21:02:03 +00:00
&& sed -i "s/storage: .*/storage: ${STORAGE},/g" customize/config.js
2017-04-09 09:36:33 +00:00
[ -n "$LOG_TO_STDOUT" ] && echo "Logging to stdout: $LOG_TO_STDOUT" \
2016-12-29 21:02:03 +00:00
&& sed -i "s/logToStdout: .*/logToStdout: ${LOG_TO_STDOUT},/g" customize/config.js
2017-04-08 20:08:38 +00:00
exec node ./server.js