Made names consistent

This commit is contained in:
Daan Selen 2025-03-25 15:16:39 +01:00
parent db7eacbca3
commit 9e6b98a031

View File

@ -93,7 +93,7 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
echo "If defaults are going to get applied, refer to: https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json"
# SESSIONKEY
if [[ $REGENSESSIONKEY =~ ^(true|yes)$ ]]; then
if [[ $REGEN_SESSIONKEY =~ ^(true|yes)$ ]]; then
echo "Regenerating Session-Key because REGENSESSIONKEY is 'true' or 'yes'"
SESSION_KEY=$(tr -dc 'A-Z0-9' < /dev/urandom | fold -w 96 | head -n 1)
@ -120,15 +120,15 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
fi
# ALLOWPLUGINS
if [[ -n $ALLOWPLUGINS ]] && [[ $ALLOWPLUGINS =~ ^(true|false)$ ]]; then
echo "Setting plugins... $ALLOWPLUGINS"
if [[ -n $ALLOW_PLUGINS ]] && [[ $ALLOW_PLUGINS =~ ^(true|false)$ ]]; then
echo "Setting plugins... $ALLOW_PLUGINS"
sed -i 's/"_plugins"/"plugins"/' "$CONFIG_FILE"
jq --argjson allow_plugins "$ALLOWPLUGINS" \
jq --argjson allow_plugins "$ALLOW_PLUGINS" \
'.settings.plugins.enabled = $allow_plugins' \
"$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
else
echo "Invalid or no ALLOWPLUGINS value given, commenting out so default applies... Value given: $ALLOWPLUGINS"
echo "Invalid or no ALLOWPLUGINS value given, commenting out so default applies... Value given: $ALLOW_PLUGINS"
sed -i 's/"plugins":/"_plugins":/g' "$CONFIG_FILE"
fi
@ -193,15 +193,15 @@ if [[ "$DYNAMIC_CONFIG" =~ ^(true|yes)$ ]]; then
fi
# LOCALSESSIONRECORDING
if [[ -n $LOCALSESSIONRECORDING ]] && [[ $LOCALSESSIONRECORDING =~ ^(true|false)$ ]]; then
echo "Setting localSessionRecording... $LOCALSESSIONRECORDING"
if [[ -n $LOCAL_SESSION_RECORDING ]] && [[ $LOCAL_SESSION_RECORDING =~ ^(true|false)$ ]]; then
echo "Setting localSessionRecording... $LOCAL_SESSION_RECORDING"
sed -i 's/"_localSessionRecording"/"localSessionRecording"/' "$CONFIG_FILE"
jq --argjson session_recording "$LOCALSESSIONRECORDING" \
jq --argjson session_recording "$LOCAL_SESSION_RECORDING" \
'.domains[""].localSessionRecording = $session_recording' \
"$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
else
echo "Invalid or no LOCALSESSIONRECORDING value given, commenting out so default applies... Value given: $LOCALSESSIONRECORDING"
echo "Invalid or no LOCALSESSIONRECORDING value given, commenting out so default applies... Value given: $LOCAL_SESSION_RECORDING"
sed -i 's/"localSessionRecording":/"_localSessionRecording":/g' "$CONFIG_FILE"
fi