From 2175740b69747bf25121388a510755c4624b8685 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Sat, 10 Jun 2023 20:33:21 +0500 Subject: [PATCH] Correct the substitution of machinekey characters used in sed --- run-community-server.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run-community-server.sh b/run-community-server.sh index 6ba4673..bd30ff5 100644 --- a/run-community-server.sh +++ b/run-community-server.sh @@ -889,12 +889,12 @@ do sed '/web.warmup.count/s/value=\"\S*\"/value=\"'${APP_MONOSERVE_COUNT}'\"/g' -i ${APP_ROOT_DIR}/web.appsettings.config sed '/web.warmup.domain/s/value=\"\S*\"/value=\"localhost\/warmup\"/g' -i ${APP_ROOT_DIR}/web.appsettings.config - sed "s^\(machine_key\)\s*=.*^\1 = ${APP_CORE_MACHINEKEY}^g" -i ${APP_SERVICES_DIR}/TeamLabSvc/radicale.config + sed "s^\(machine_key\)\s*=.*^\1 = ${APP_CORE_MACHINEKEY//^/\\^}^g" -i ${APP_SERVICES_DIR}/TeamLabSvc/radicale.config binDirs=("$APP_APISYSTEM_DIR" "$APP_SERVICES_DIR" "$APP_ROOT_DIR" "$APP_CONFIG_DIR") for i in "${!binDirs[@]}"; do - find "${binDirs[$i]}" -type f -name "*.[cC]onfig" -exec sed -i "/core.\machinekey/s_\(value\s*=\s*\"\)[^\"]*\"_\1${APP_CORE_MACHINEKEY}\"_" {} \; - find "${binDirs[$i]}" -type f -name "*.json" -exec sed -i "s_\(\"core.machinekey\":\|\"machinekey\":\).*,_\1 \"${APP_CORE_MACHINEKEY}\",_" {} \; + find "${binDirs[$i]}" -type f -name "*.[cC]onfig" -exec sed -i "/core.\machinekey/s_\(value\s*=\s*\"\)[^\"]*\"_\1${APP_CORE_MACHINEKEY//_/\\_}\"_" {} \; + find "${binDirs[$i]}" -type f -name "*.json" -exec sed -i "s_\(\"core.machinekey\":\|\"machinekey\":\).*,_\1 \"${APP_CORE_MACHINEKEY//_/\\_}\",_" {} \; done continue;