cryptpad/container-start.sh

24 lines
803 B
Bash
Raw Normal View History

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