1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-07 16:06:14 +00:00

handle true/false differently in webapp config (#115)

* true/false should not be put in quotes as its boolean
* add a tab before inserting
This commit is contained in:
Felix Bartels 2019-03-18 16:57:19 +01:00 committed by GitHub
parent 140506df7d
commit 9a6dbd4a20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,15 @@ php_cfg_gen() {
if [ -e "$cfg_file" ]; then
if grep -q "$cfg_setting" "$cfg_file"; then
echo "Setting $cfg_setting = $cfg_value in $cfg_file"
sed -ri "s#(\s*define).+${cfg_setting}.+#\define(\x27${cfg_setting}\x27, \x27${cfg_value}\x27\);#g" "$cfg_file"
case $cfg_value in
true|TRUE|false|FALSE)
echo boolean value
sed -ri "s#(\s*define).+${cfg_setting}.+#\tdefine(\x27${cfg_setting}\x27, ${cfg_value}\);#g" "$cfg_file"
;;
*)
sed -ri "s#(\s*define).+${cfg_setting}.+#\tdefine(\x27${cfg_setting}\x27, \x27${cfg_value}\x27\);#g" "$cfg_file"
;;
esac
else
echo "Error: Config option $cfg_setting not found in $cfg_file"
cat "$cfg_file"