mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 21:34:12 -07:00
replace_php_config_value function
This commit is contained in:
parent
8e3b348e6f
commit
e4b0be46b6
1 changed files with 12 additions and 0 deletions
12
func/main.sh
12
func/main.sh
|
@ -1045,3 +1045,15 @@ escape_shell_quote() {
|
||||||
local escape_shell_quoted=${1//\'/\'\\\'\'};
|
local escape_shell_quoted=${1//\'/\'\\\'\'};
|
||||||
printf "'%s'" "$escape_shell_quoted"
|
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
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue