From d81331adc26aa5d89c6e4df018045bf9f19007a7 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 6 Jul 2025 07:42:24 +0200 Subject: [PATCH] Update 01-config_yaml.sh --- .templates/01-config_yaml.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.templates/01-config_yaml.sh b/.templates/01-config_yaml.sh index 409cbaccc..3af0293ec 100644 --- a/.templates/01-config_yaml.sh +++ b/.templates/01-config_yaml.sh @@ -74,7 +74,9 @@ dq_escape() { while IFS= read -r LINE; do [[ -z "$LINE" || "$LINE" != *=* ]] && continue - KEY="${LINE%%=*}" + # Escape special characters not within single quotes + LINE=$(sed -E "s/([^'])([][\$\`\"\\!&;|<>])/\1\\\\\\2/g" <<< "$LINE") + KEY="${LINE%%=*}" VALUE="${LINE#*=}" # !secret handling if [[ "$VALUE" =~ ^!secret[[:space:]]+(.+) ]]; then