done
# Put hosts, language and key in main.inc.php
- cat /usr/share/roundcube/main.inc.php.dist | \
- sed -e "s+^\(\$rcmail_config\['default_host'\] = \)''\(;\)\$+\1${hosts}\2+" \
- -e "s+^\(\$rcmail_config\['des_key'\] = '\).*\(';\)\$+\1$deskey\2+" \
- -e "s+^\(\$rcmail_config\['language'\] = \).*\(;\)\$+\1'${language}'\2+" >> $CONFFILE.ucftmp
+ cat /usr/share/roundcube/main.inc.php.dist | while read line; do
+ case "$line" in
+ "\$rcmail_config['default_host'] = "*)
+ printf "\$rcmail_config['default_host'] = %s;\n" "${hosts}"
+ ;;
+ "\$rcmail_config['des_key'] = "*)
+ printf "\$rcmail_config['des_key'] = '%s';\n" "${deskey}"
+ ;;
+ "\$rcmail_config['language'] = "*)
+ printf "\$rcmail_config['language'] = '%s';\n" "${language}"
+ ;;
+ *)
+ printf "%s\n" "$line"
+ ;;
+ esac
+ done >> $CONFFILE.ucftmp
ucf --debconf-ok $CONFFILE.ucftmp $CONFFILE
chown root:www-data $CONFFILE