-set_lx_office_erp_authentication_db_user() {
- USER="lxoffice"
-
- cat /usr/lib/lx-office-erp/config/authentication.pl | \
- sed --expression "s/'user' => 'postgres',/'user' => '$USER',/g" \
- > /tmp/1.txt
-
- mv /tmp/1.txt /usr/lib/lx-office-erp/config/authentication.pl
+mk_links() {
+ for file in lx_office.conf lx_office.conf.default ; do
+ test -f /usr/lib/lx-office-erp/config/${file} || ln -s /etc/lx-office-erp/${file} /usr/lib/lx-office-erp/config/${file}
+ done
+ for file in lx-erp.conf authentication.pl ; do
+ if [ -f /usr/lib/lx-office-erp/config/${file} ] ; then
+ rm /usr/lib/lx-office-erp/config/${file}
+ fi
+ done
+ if [ -e /etc/apache2 ] ; then
+ if ! [ -f /etc/apache2/conf.d/lx-office-erp.apache2.conf ] ; then
+ ln -s /etc/lx-office-erp/lx-office-erp.apache2.conf /etc/apache2/conf.d/lx-office-erp.apache2.conf
+ fi;
+ fi;
+ if [ -e /etc/cherokee/sites-available ] ; then
+ if ! [ -f /etc/cherokee/sites-available/lx-office-erp.cherokee ] ; then
+ cat /etc/lx-office-erp/lx-office-erp.cherokee.handler >> /etc/cherokee/sites-available/default
+ ln -s /etc/lx-office-erp/lx-office-erp.cherokee /etc/cherokee/sites-available/lx-office-erp.cherokee
+ fi;
+ fi;
+ if [ -e /etc/lighttpd ] ; then
+ if ! [ -f /etc/lighttpd/conf-enabled/lx-office-erp.lighttpd ] ; then
+ ln -s /etc/lx-office-erp/lx-office-erp.lighttpd /etc/lighttpf/conf-enabled/10-lx-office-erp
+ fi;
+ fi;
+}
+web_server_ctrl() {
+ local action=$1
+ if [ -x "/etc/init.d/apache2" ]; then
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ invoke-rc.d apache2 $action ||true
+ else
+ /etc/init.d/apache2 $action ||true
+ fi
+ fi
+ if [ -f /etc/init.d/cherokee ] ; then
+ /etc/init.d/cherokee $action || true
+ fi
+ if [ -f /etc/init.d/lighttpd ] ; then
+ /etc/init.d/lighttpd $action || true
+ fi
+
+ # if [ $action = restart ] ; then
+ # echo Sleeping
+ # sleep 5
+ # echo Awake
+ # fi