Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3769992
D2317.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D2317.diff
View Options
diff --git a/entrypoint.sh b/entrypoint.sh
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -9,13 +9,11 @@
# if we're linked to MySQL, and we're using the root user, and our linked
# container has a default "root" password set up and passed through... :)
-: ${ETHERPAD_DB_USER:=root}
+: "${ETHERPAD_DB_USER:=root}"
if [ "$ETHERPAD_DB_USER" = 'root' ]; then
- : ${ETHERPAD_DB_PASSWORD:=$MYSQL_ENV_MYSQL_ROOT_PASSWORD}
+ : "${ETHERPAD_DB_PASSWORD:=$MYSQL_ENV_MYSQL_ROOT_PASSWORD}"
fi
-: ${ETHERPAD_DB_NAME:=etherpad}
-
-ETHERPAD_DB_NAME=$( echo $ETHERPAD_DB_NAME | sed 's/\./_/g' )
+: "${ETHERPAD_DB_NAME:=etherpad}"
if [ -z "$ETHERPAD_DB_PASSWORD" ]; then
echo >&2 'error: missing required ETHERPAD_DB_PASSWORD environment variable'
@@ -25,21 +23,20 @@
exit 1
fi
-: ${ETHERPAD_TITLE:=Etherpad}
-: ${ETHERPAD_PORT:=9001}
-: ${ETHERPAD_SESSION_KEY:=$(
- node -p "require('crypto').randomBytes(32).toString('hex')")}
+: "${ETHERPAD_TITLE:=Etherpad}"
+: "${ETHERPAD_PORT:=9001}"
+: "${ETHERPAD_SESSION_KEY:=$(node -p "require('crypto').randomBytes(32).toString('hex')")}"
# Check if database already exists
-RESULT=`mysql -u${ETHERPAD_DB_USER} -p${ETHERPAD_DB_PASSWORD} \
+RESULT=$(mysql -u"${ETHERPAD_DB_USER}" -p"${ETHERPAD_DB_PASSWORD}" \
-hmysql --skip-column-names \
- -e "SHOW DATABASES LIKE '${ETHERPAD_DB_NAME}'"`
+ -e "SHOW DATABASES LIKE '${ETHERPAD_DB_NAME}'")
-if [ "$RESULT" != $ETHERPAD_DB_NAME ]; then
+if [ "$RESULT" != "$ETHERPAD_DB_NAME" ]; then
# mysql database does not exist, create it
echo "Creating database ${ETHERPAD_DB_NAME}"
- mysql -u${ETHERPAD_DB_USER} -p${ETHERPAD_DB_PASSWORD} -hmysql \
+ mysql -u"${ETHERPAD_DB_USER}" -p"${ETHERPAD_DB_PASSWORD}" -hmysql \
-e "create database ${ETHERPAD_DB_NAME}"
fi
@@ -60,9 +57,9 @@
},
EOF
- if [ $ETHERPAD_ADMIN_PASSWORD ]; then
+ if [ "$ETHERPAD_ADMIN_PASSWORD" ]; then
- : ${ETHERPAD_ADMIN_USER:=admin}
+ ": ${ETHERPAD_ADMIN_USER:=admin}"
cat <<- EOF >> settings.json
"users": {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 18:41 (21 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260730
Default Alt Text
D2317.diff (1 KB)
Attached To
Mode
D2317: Improve entry point syntax
Attached
Detach File
Event Timeline
Log In to Comment