Try this instead :
sed -i "s/\$cfg\[.blowfish_secret.\]\s*=.*/$replace/" file
If you put _single-quotes_ around variables, the variables can't be expanded
Try this instead :
sed -i "s/\$cfg\[.blowfish_secret.\]\s*=.*/$replace/" file
If you put _single-quotes_ around variables, the variables can't be expanded