From e4b0be46b63b2d4b141eac38f84f79a1eb031ac5 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 12 Jul 2020 20:38:06 +0200 Subject: [PATCH] replace_php_config_value function --- func/main.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/func/main.sh b/func/main.sh index 5d85e7e4..d86d3e59 100644 --- a/func/main.sh +++ b/func/main.sh @@ -1045,3 +1045,15 @@ escape_shell_quote() { local escape_shell_quoted=${1//\'/\'\\\'\'}; printf "'%s'" "$escape_shell_quoted" } + +replace_php_config_value() { + if [ ! -z $4 ]; then + if [ "$4" = "yes" ] || [ $4 -eq 1 ]; then + echo "=== Replacing $1 to $2 in $3" + fi + fi + sed -i "s|'$1'|'$2'|g" $3 + sed -i "s|\"$1\"|\"$2\"|g" $3 + sed -i "s|=$1$|=$2|g" $3 + sed -i "s|= $1$|= $2|g" $3 +}