From 0b8ba6471d79f6ad480388a34cc5e6fc590e514f Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Wed, 13 Feb 2019 15:34:10 -0200 Subject: [PATCH] Sanitize environment variable names (like affinity:container) --- conf/postfix-service.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/postfix-service.sh b/conf/postfix-service.sh index 5d58a24..64084d7 100755 --- a/conf/postfix-service.sh +++ b/conf/postfix-service.sh @@ -7,7 +7,8 @@ function log { function serviceConf { # Substitute configuration for VARIABLE in `env | cut -f1 -d=`; do - sed -i "s={{ $VARIABLE }}=${!VARIABLE}=g" /etc/postfix/*.cf + VAR=${VARIABLE//:/_} + sed -i "s={{ $VAR }}=${!VAR}=g" /etc/postfix/*.cf done # Override Postfix configuration