pdubois / docker-alfresco

28 stars 21 forks source link

Env Var value does not get extracted correctly if it contains an equals sign #8

Closed derFunk closed 6 years ago

derFunk commented 6 years ago

Description

This line does not work when the variable value contains an equals sign, like ALF_32=ldap.synchronization.groupSearchBase=OU\=Application,OU\=Groups:

https://github.com/pdubois/docker-alfresco/blob/b70a1e36afa6f9ce16e09a6cb45e7515c2b69839/tuneglobal.sh#L20

The output is: varvalue:OU. Expected: varvalue:OU\=Application,OU\=Groups. Reason: printf "${!val}" | awk -F "\.EQ\.|=" '{print $2}' splits the line by equal signs and takes the second column's value, which in this case is OU.

Working fix

Instead this (Line 20):

varvalue=`printf "${!val}" | awk -F "\.EQ\.|=" '{print $2}'`

do this, which sets everything behind .EQ. as varvalue.

varvalue=`echo ${!val#*'.EQ.'}`