2 # postinst script for lx-office-erp-svn
4 # see: dh_installdeb(1)
10 echo " ! "`date`" Postinst $1 !" >> /tmp/lxo-erp.log
12 source /usr/share/debconf/confmodule
14 # summary of how this script can be called:
15 # * <postinst> `configure' <most-recently-configured-version>
16 # * <old-postinst> `abort-upgrade' <new version>
17 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
19 # * <postinst> `abort-remove'
20 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
21 # <failed-install-package> <version> `removing'
22 # <conflicting-package> <version>
23 # for details, see http://www.debian.org/doc/debian-policy/ or
24 # the debian-policy package
27 config_postgresql_factory_script() {
29 echo "Starting factory postgresql config script: scripts/inst_postgres_deb.sh.."
30 cd /usr/lib/lx-office-erp/
31 ./scripts/inst_postgres_deb.sh
32 echo "Factory postgresql config script done."
36 set_lx_office_erp_web_admin_password() {
37 db_get lx-office-erp/admin-password
40 sed --in-place --expression "s/^admin_password.*=.*/admin_password = $ADMINPASSWORD/" /etc/lx-office-erp/lx_office.conf
44 set_lx_office_erp_authentication_db_user_password() {
45 db_get lx-office-erp/lx-office-erp-user-postgresql-password
48 sed --in-place --expression "s/^password.*=.*/password = $PASSWORD/" /etc/lx-office-erp/lx_office.conf
49 sed --in-place --expression "s/^user.*=.*postgres/user = lxoffice/g" /etc/lx-office-erp/lx_office.conf
54 chown -R www-data:www-data /usr/lib/lx-office-erp/users
55 chown -R www-data:www-data /usr/lib/lx-office-erp/templates
56 chown www-data:www-data /etc/lx-office-erp/lx_office.conf
57 chown www-data:www-data /usr/lib/lx-office-erp/menu.ini
58 chmod 0600 /etc/lx-office-erp/lx_office.conf
62 if [ -e /usr/lib/lx-office-crm ] ; then
63 #crm vorhanden, dann die menu.ini mit der höchsten VersNr nehmen
64 for i in `ls -1 /usr/lib/lx-office-crm/update/menu*ini` ; do
65 cat $i > /usr/lib/lx-office-erp/menu.ini
67 cat /usr/lib/lx-office-erp/menu.default >> /usr/lib/lx-office-erp/menu.ini
69 cp /usr/lib/lx-office-erp/menu.default /usr/lib/lx-office-erp/menu.ini
74 if ! [ -f /etc/lx-office-erp/lx_office.conf ] ; then
75 cp /etc/lx-office-erp/lx_office.conf.default /etc/lx-office-erp/lx_office.conf
80 if ! [ -f /usr/lib/lx-office-erp/config/lx_office.conf ] ; then
81 ln -s /etc/lx-office-erp/lx_office.conf /usr/lib/lx-office-erp/config/lx_office.conf
83 if [ -e /etc/apache2 ] ; then
84 if ! [ -f /etc/apache2/conf.d/lx-office-erp.apache2.conf ] ; then
85 ln -s /etc/lx-office-erp/lx-office-erp.apache2.conf /etc/apache2/conf.d/lx-office-erp.apache2.conf
88 if [ -e /etc/cherokee/sites-available ] ; then
89 if ! [ -f /etc/cherokee/sites-available/lx-office-erp.cherokee ] ; then
90 cat /etc/lx-office-erp/lx-office-erp.cherokee.handler >> /etc/cherokee/sites-available/default
91 ln -s /etc/lx-office-erp/lx-office-erp.cherokee /etc/cherokee/sites-available/lx-office-erp.cherokee
94 if [ -e /etc/lighttpd ] ; then
95 if ! [ -f /etc/lighttpd/conf-enabled/lx-office-erp.lighttpd ] ; then
96 ln -s /etc/lx-office-erp/lx-office-erp.lighttpd /etc/lighttpf/conf-enabled/10-lx-office-erp
100 reload_web_server() {
101 if [ -f /etc/init.d/apache* ] ; then
102 /etc/init.d/apache* reload
104 if [ -f /etc/init.d/cherokee ] ; then
105 /etc/init.d/cherokee reload
107 if [ -f /etc/init.d/lighttpd ] ; then
108 /etc/init.d/lighttpd reload
114 echo " ! "`date`" $1 !" >> /tmp/lxo-erp.log
116 VER=`cat /var/www/lx-office-erp/VERSION | cut -d '.' -f2`
117 if [ $VER = '7' ]; then
118 echo " ! 2.7 !" >> /tmp/lxo-erp.log
124 config_postgresql_factory_script
125 set_lx_office_erp_web_admin_password
126 set_lx_office_erp_authentication_db_user_password
135 echo " ! "`date`" $1 !" >> /tmp/lxo-erp.log
139 config_postgresql_factory_script
140 set_lx_office_erp_web_admin_password
141 set_lx_office_erp_authentication_db_user_password
149 abort-upgrade|abort-remove|abort-deconfigure)
153 echo "postinst called with unknown argument \`$1'" >&2