Removed case sensitivity in true/false prompts
Daan Selen committed
Apr 9, 2025 at 16:12 UTC
8b2dcf4d9df43f8e069e22ce5f28756dcafbdbd4
1 file changed
+12
-12
docker/entrypoint.sh
+12
-12
@@ -21,12 +21,12 @@ else
21
cp /opt/meshcentral/config.json.template "${CONFIG_FILE}"
22
fi
23
24
-if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
24
+if [[ ${DYNAMIC_CONFIG,,} =~ ^(true|yes)$ ]]; then
25
cat "$CONFIG_FILE"
26
echo "Using Dynamic Configuration values..."
27
28
# BEGIN DATABASE CONFIGURATION FIELDS
29
- if [[ "$USE_MONGODB" =~ ^(true|yes)$ ]]; then
29
+ if [[ ${USE_MONGODB,,} =~ ^(true|yes)$ ]]; then
30
echo "Enabling MongoDB-connector..."
31
32
if [[ -n "$MONGO_URL" ]]; then
@@ -45,7 +45,7 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
45
sed -i 's/"mongoDb"/"_mongoDb"/' "$CONFIG_FILE"
46
fi
47
48
- if [[ "$USE_POSTGRESQL" =~ ^(true|yes)$ ]]; then
48
+ if [[ ${USE_POSTGRESQL,,} =~ ^(true|yes)$ ]]; then
49
echo "Enabling PostgreSQL-connector..."
50
51
sed -i 's/"_postgres"/"postgres"/' "$CONFIG_FILE"
@@ -65,7 +65,7 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
65
sed -i 's/"postgres"/"_postgres"/' "$CONFIG_FILE"
66
fi
67
68
- if [[ "$USE_MARIADB" =~ ^(true|yes)$ ]]; then
68
+ if [[ ${USE_MARIADB,,} =~ ^(true|yes)$ ]]; then
69
echo "Enabling MariaDB-connector..."
70
sed -i 's/"_mariaDB"/"mariaDB"/' "$CONFIG_FILE"
71
jq --arg mariadb_host "$MARIADB_HOST" \
@@ -93,7 +93,7 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
93
echo "If defaults are going to get applied, refer to: https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json"
94
95
# SESSIONKEY
96
- if [[ $REGEN_SESSIONKEY =~ ^(true|yes)$ ]]; then
96
+ if [[ ${REGEN_SESSIONKEY,,} =~ ^(true|yes)$ ]]; then
97
echo "Regenerating Session-Key because REGENSESSIONKEY is 'true' or 'yes'"
98
SESSION_KEY=$(tr -dc 'A-Z0-9' < /dev/urandom | fold -w 96 | head -n 1)
99
@@ -120,7 +120,7 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
120
fi
121
122
# ALLOWPLUGINS
123
- if [[ -n $ALLOW_PLUGINS ]] && [[ $ALLOW_PLUGINS =~ ^(true|false)$ ]]; then
123
+ if [[ ${ALLOW_PLUGINS,,} =~ ^(true|false)$ ]]; then
124
echo "Setting plugins... $ALLOW_PLUGINS"
125
126
sed -i 's/"_plugins"/"plugins"/' "$CONFIG_FILE"
@@ -133,7 +133,7 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
133
fi
134
135
# WEBRTC
136
- if [[ -n $WEBRTC ]] && [[ $WEBRTC =~ ^(true|false)$ ]]; then
136
+ if [[ ${WEBRTC,,} =~ ^(true|false)$ ]]; then
137
echo "Setting WebRTC... $WEBRTC"
138
139
sed -i 's/"_WebRTC"/"WebRTC"/' "$CONFIG_FILE"
@@ -147,7 +147,7 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
147
fi
148
149
# IFRAME
150
- if [[ -n $IFRAME ]] && [[ $IFRAME =~ ^(true|false)$ ]]; then
150
+ if [[ ${IFRAME,,} =~ ^(true|false)$ ]]; then
151
echo "Setting AllowFraming... $IFRAME"
152
153
sed -i 's/"_AllowFraming"/"AllowFraming"/' "$CONFIG_FILE"
@@ -180,7 +180,7 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
180
fi
181
182
# ALLOW_NEW_ACCOUNTS
183
- if [[ -n $ALLOW_NEW_ACCOUNTS ]] && [[ $ALLOW_NEW_ACCOUNTS =~ ^(true|false)$ ]]; then
183
+ if [[ ${ALLOW_NEW_ACCOUNTS,,} =~ ^(true|false)$ ]]; then
184
echo "Setting NewAccounts... $ALLOW_NEW_ACCOUNTS"
185
186
sed -i 's/"_NewAccounts"/"NewAccounts"/' "$CONFIG_FILE"
@@ -193,7 +193,7 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
193
fi
194
195
# LOCALSESSIONRECORDING
196
- if [[ -n $LOCAL_SESSION_RECORDING ]] && [[ $LOCAL_SESSION_RECORDING =~ ^(true|false)$ ]]; then
196
+ if [[ ${LOCAL_SESSION_RECORDING,,} =~ ^(true|false)$ ]]; then
197
echo "Setting localSessionRecording... $LOCAL_SESSION_RECORDING"
198
199
sed -i 's/"_localSessionRecording"/"localSessionRecording"/' "$CONFIG_FILE"
@@ -206,7 +206,7 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
206
fi
207
208
# MINIFY
209
- if [[ -n $MINIFY ]] && [[ $MINIFY =~ ^(true|false)$ ]]; then
209
+ if [[ ${MINIFY,,} =~ ^(true|false)$ ]]; then
210
echo "Setting minify... $MINIFY"
211
212
sed -i 's/"_minify"/"minify"/' "$CONFIG_FILE"
@@ -220,7 +220,7 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
220
fi
221
222
# ALLOWED_ORIGIN
223
- if [[ -n $ALLOWED_ORIGIN ]] && [[ $ALLOWED_ORIGIN =~ ^(true|false)$ ]]; then
223
+ if [[ ${ALLOWED_ORIGIN,,} =~ ^(true|false)$ ]]; then
224
echo "Setting allowedOrigin... $ALLOWED_ORIGIN"
225
226
sed -i 's/"_allowedOrigin"/"allowedOrigin"/' "$CONFIG_FILE"