2 # postinst script for lx-office-erp-svn
4 # see: dh_installdeb(1)
11 debugfile=$(mktemp /tmp/lx-erp.log.XXXXXX)
12 echo " ! "`date`" Postinst $1 !" >> $debugfile
14 source /usr/share/debconf/confmodule
16 # summary of how this script can be called:
17 # * <postinst> `configure' <most-recently-configured-version>
18 # * <old-postinst> `abort-upgrade' <new version>
19 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
21 # * <postinst> `abort-remove'
22 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
23 # <failed-install-package> <version> `removing'
24 # <conflicting-package> <version>
25 # for details, see http://www.debian.org/doc/debian-policy/ or
26 # the debian-policy package
29 config_postgresql_factory_script() {
31 echo "Starting factory postgresql config script: scripts/inst_postgres_deb.sh.."
32 cd /usr/lib/lx-office-erp/
33 ./scripts/inst_postgres_deb.sh
34 echo "Factory postgresql config script done."
38 set_lx_office_erp_web_admin_password() {
39 db_get lx-office-erp/admin-password
42 sed --in-place --expression "s/^admin_password.*=.*/admin_password = $ADMINPASSWORD/" /etc/lx-office-erp/lx_office.conf
46 set_lx_office_erp_authentication_db_user_password() {
47 db_get lx-office-erp/lx-office-erp-user-postgresql-password
50 sed --in-place --expression "s/^password.*=.*/password = $PASSWORD/" /etc/lx-office-erp/lx_office.conf
51 sed --in-place --expression "s/^user.*=.*postgres/user = lxoffice/g" /etc/lx-office-erp/lx_office.conf
56 chown -R www-data:www-data /usr/lib/lx-office-erp/users
57 chown -R www-data:www-data /usr/lib/lx-office-erp/templates
58 chown www-data:www-data /etc/lx-office-erp/lx_office.conf
59 chown www-data:www-data /usr/lib/lx-office-erp/menu.ini
60 chmod 0600 /etc/lx-office-erp/lx_office.conf
64 if [ -e /usr/lib/lx-office-crm ] ; then
65 #crm vorhanden, dann die menu.ini mit der höchsten VersNr nehmen
66 for i in `ls -1 /usr/lib/lx-office-crm/update/menu*ini` ; do
67 cat $i > /usr/lib/lx-office-erp/menu.ini
69 cat /usr/lib/lx-office-erp/menu.default >> /usr/lib/lx-office-erp/menu.ini
71 cp /usr/lib/lx-office-erp/menu.default /usr/lib/lx-office-erp/menu.ini
76 if ! [ -f /etc/lx-office-erp/lx_office.conf ] ; then
77 cp /etc/lx-office-erp/lx_office.conf.default /etc/lx-office-erp/lx_office.conf
82 if ! [ -f /usr/lib/lx-office-erp/config/lx_office.conf ] ; then
83 ln -s /etc/lx-office-erp/lx_office.conf /usr/lib/lx-office-erp/config/lx_office.conf
85 if [ -e /etc/apache2 ] ; then
86 if ! [ -f /etc/apache2/conf.d/lx-office-erp.apache2.conf ] ; then
87 ln -s /etc/lx-office-erp/lx-office-erp.apache2.conf /etc/apache2/conf.d/lx-office-erp.apache2.conf
90 if [ -e /etc/cherokee/sites-available ] ; then
91 if ! [ -f /etc/cherokee/sites-available/lx-office-erp.cherokee ] ; then
92 cat /etc/lx-office-erp/lx-office-erp.cherokee.handler >> /etc/cherokee/sites-available/default
93 ln -s /etc/lx-office-erp/lx-office-erp.cherokee /etc/cherokee/sites-available/lx-office-erp.cherokee
96 if [ -e /etc/lighttpd ] ; then
97 if ! [ -f /etc/lighttpd/conf-enabled/lx-office-erp.lighttpd ] ; then
98 ln -s /etc/lx-office-erp/lx-office-erp.lighttpd /etc/lighttpf/conf-enabled/10-lx-office-erp
102 reload_web_server() {
103 if [ -f /etc/init.d/apache* ] ; then
104 /etc/init.d/apache* reload
106 if [ -f /etc/init.d/cherokee ] ; then
107 /etc/init.d/cherokee reload
109 if [ -f /etc/init.d/lighttpd ] ; then
110 /etc/init.d/lighttpd reload
116 echo " ! "`date`" $1 !" >> $debugfile
118 VER=`cat /var/www/lx-office-erp/VERSION | cut -d '.' -f2`
119 if [ $VER = '7' ]; then
120 echo " ! 2.7 !" >> $debugfile
126 config_postgresql_factory_script
127 set_lx_office_erp_web_admin_password
128 set_lx_office_erp_authentication_db_user_password
137 echo " ! "`date`" $1 !" >> $debugfile
141 config_postgresql_factory_script
142 set_lx_office_erp_web_admin_password
143 set_lx_office_erp_authentication_db_user_password
151 abort-upgrade|abort-remove|abort-deconfigure)
155 echo "postinst called with unknown argument \`$1'" >&2