sed -e "s|'standardlanguage', 'English'|'standardlanguage', '${MYLANG}'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change default language"
fi
einfo "Setting 'lastguid' to '10000'"
sed -e "s|'lastguid', '9999'|'lastguid', '10000'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change lastguid"
# set correct webserver reload
if use lighttpd;then
einfo "Switching settings to fit 'lighttpd'"
sed -e "s|/etc/init.d/apache reload|/etc/init.d/lighttpd restart|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver restart-command"
sed -e "s|'webserver', 'apache2'|'webserver', 'lighttpd'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver version"
sed -e "s|'apacheconf_vhost', '/etc/apache/vhosts.conf'|'apacheconf_vhost', '/etc/lighttpd/froxlor-vhosts.conf'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver vhost directory"
sed -e "s|'apacheconf_diroptions', '/etc/apache/diroptions.conf'|'apacheconf_diroptions', '/etc/lighttpd/diroptions.conf'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver diroptions file"
sed -e "s|'apacheconf_htpasswddir', '/etc/apache/htpasswd/'|'apacheconf_htpasswddir', '/etc/lighttpd/htpasswd/'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver htpasswd directory"
sed -e "s|'httpuser', 'www-data'|'httpuser', 'lighttpd'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver user"
sed -e "s|'httpgroup', 'www-data'|'httpgroup', 'lighttpd'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver group"
sed -e "s|'fastcgi_ipcdir', '/var/lib/apache2/fastcgi/'|'fastcgi_ipcdir', '/var/run/lighttpd/'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change php-ipc directory"
sed -e "s|/etc/init.d/apache reload|/etc/init.d/nginx restart|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver restart-command"
sed -e "s|'webserver', 'apache2'|'webserver', 'nginx'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver version"
sed -e "s|'apacheconf_vhost', '/etc/apache/vhosts.conf'|'apacheconf_vhost', '/etc/nginx/froxlor-vhosts.conf'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver vhost directory"
sed -e "s|'apacheconf_diroptions', '/etc/apache/diroptions.conf'|'apacheconf_diroptions', '/etc/nginx/diroptions.conf'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver diroptions file"
sed -e "s|'apacheconf_htpasswddir', '/etc/apache/htpasswd/'|'apacheconf_htpasswddir', '/etc/nginx/htpasswd/'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver htpasswd directory"
sed -e "s|'httpuser', 'www-data'|'httpuser', 'nginx'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver user"
sed -e "s|'httpgroup', 'www-data'|'httpgroup', 'nginx'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver group"
sed -e "s|'fastcgi_ipcdir', '/var/lib/apache2/fastcgi/'|'fastcgi_ipcdir', '/var/run/nginx/'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change php-ipc directory"
sed -e "s|/etc/init.d/apache reload|/etc/init.d/apache2 reload|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver restart-command"
sed -e "s|'apacheconf_vhost', '/etc/apache/vhosts.conf'|'apacheconf_vhost', '/etc/apache2/vhosts.d/99_froxlor-vhosts.conf'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver vhost directory"
sed -e "s|'apacheconf_diroptions', '/etc/apache/diroptions.conf'|'apacheconf_diroptions', '/etc/apache2/diroptions.conf'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver diroptions file"
sed -e "s|'apacheconf_htpasswddir', '/etc/apache/htpasswd/'|'apacheconf_htpasswddir', '/etc/apache2/htpasswd/'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver htpasswd directory"
sed -e "s|'httpuser', 'www-data'|'httpuser', 'apache'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver user"
sed -e "s|'httpgroup', 'www-data'|'httpgroup', 'apache'|g" -i "${S}/install/froxlor.sql"|| die "Unable to change webserver group"
fi
if use fcgid && ! use lighttpd && ! use nginx ;then
einfo "Switching 'fcgid' to 'On'"
sed -e "s|'mod_fcgid', '0'|'mod_fcgid', '1'|g" -i "${S}/install/froxlor.sql"|| die "Unable to set fcgid to 'On'"
sed -e "s|'mod_fcgid_wrapper', '0'|'mod_fcgid_wrapper', '1'|g" -i "${S}/install/froxlor.sql"|| die "Unable to set fcgi-wrapper to 'FCGIWrapper'"
fi
if use fpm ;then
einfo "Switching 'fpm' to 'On'"
sed -e "s|'phpfpm', 'enabled', '0'|'phpfpm', 'enabled', '1'|g" -i "${S}/install/froxlor.sql"|| die "Unable to set fpm to 'On'"
einfo "Setting configdir for fpm"
sed -e "s|'phpfpm', 'configdir', '/etc/php-fpm.d/'|'phpfpm', 'configdir', '/etc/php/fpm-php5.3/fpm.d/'|g" -i "${S}/install/froxlor.sql"|| die "Unable to set configdir for 'fpm'"
# ewarn "tell here what to do for including fpm.d/*.conf"
# einfo "Enable custom configdir for fpm"
# sed -e "s|;include=/etc/php/fpm-php5.3/fpm.d/*.conf|include=/etc/php/fpm-php5.3/fpm.d/*.conf|g" -i "/etc/php/fpm-php5.3/php-fpm.conf" || die "Unable to set custom configdir for 'fpm'"
sed -e "s|'logger', 'enabled', '1'|'logger', 'enabled', '0'|g" -i "${S}/install/froxlor.sql"|| die "Unable to set logging to 'Off'"
fi
# default value is tickets_enabled='1'
if ! use tickets ;then
einfo "Switching 'tickets' to 'Off'"
sed -e "s|'ticket', 'enabled', '1'|'ticket', 'enabled', '0'|g" -i "${S}/install/froxlor.sql"|| die "Unable to set ticketsystem to 'Off'"
fi
# default value is mailquota='0'
if use mailquota ;then
einfo "Switching 'mailquota' to 'On'"
sed -e "s|'mail_quota_enabled', '0'|'mail_quota_enabled', '1'|g" -i "${S}/install/froxlor.sql"|| die "Unable to set mailquota to 'On'"
fi
# default value is autoresponder='0'
if use autoresponder ;then
einfo "Switching 'autoresponder' to 'On'"
sed -e "s|'autoresponder_active', '0'|'autoresponder_active', '1'|g" -i "${S}/install/froxlor.sql"|| die "Unable to set autoresponder to 'On'"
fi
# default value is dkim_enabled='0'
if use domainkey && use bind;then
einfo "Switching 'domainkey' to 'On'"
sed -e "s|'use_dkim', '0'|'use_dkim', '1'|g" -i "${S}/install/froxlor.sql"|| die "Unable to set domainkey to 'On'"
einfo "Setting dkim-path to gentoo value"
sed -e "s|'dkim_prefix', '/etc/postfix/dkim/'|'dkim_prefix', '/etc/mail/dkim-filter/'|g" -i "${S}/install/froxlor.sql"|| die "Unable to set domainkey prefix"
fi
# default value is aps_enabled='0'
if use aps ;then
einfo "Switching 'APS' to 'On'"
sed -e "s|'aps_active', '0'|'aps_active', '1'|g" -i "${S}/install/froxlor.sql"|| die "Unable to set aps to 'On'"
# if aps is used we enable required features in the php-cli php.ini