1
0
mirror of https://github.com/zokradonh/kopano-docker.git synced 2026-08-11 16:32:59 +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
+9 -1
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"