You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ampersand needs to be escaped. In my experimentation, this SO answer looks to offer a good solution. So that section of entrypoint.sh would look like:
if! [ -z"${DATABASE_PASSWORD+x}" ];then
escaped_password=$(sed 's/[&/\]/\\&/g'<<<"$DATABASE_PASSWORD")
sed -i "s/^database\.password\s*=\s*.*\$/database.password = ${escaped_password}/" /opt/connect/conf/mirth.properties
fi
Edit: A cleaner way may be to use full line replacement (/pattern to match/c replace full line with this) like this:
if! [ -z"${DATABASE_PASSWORD+x}" ];then
sed -i "/^database\.password\s*=/c database.password = ${DATABASE_PASSWORD}" /opt/connect/conf/mirth.properties
fi
The text was updated successfully, but these errors were encountered:
If your
DATABASE_PASSWORD
includes an ampersand (&
), thesed
command that puts the password into themirth.properties
file messes up the file:The ampersand needs to be escaped. In my experimentation, this SO answer looks to offer a good solution. So that section of
entrypoint.sh
would look like:Edit: A cleaner way may be to use full line replacement (
/pattern to match/c replace full line with this
) like this:The text was updated successfully, but these errors were encountered: