[FIX]account_voucher: partial payments went away when doing partial recincilation
[odoo/odoo.git] / debian / openerp-server.postinst
1 #!/bin/sh
2
3 set -e
4
5 . /usr/share/debconf/confmodule
6
7 CONFFILE="/etc/openerp-server.conf"
8 LOGFILE="/var/log/openerp-server.log"
9
10 case "${1}" in
11         configure)
12                 db_version 2.0
13
14                 db_get openerp-server/username
15                 _USERNAME="${RET:-openerp}"
16
17                 db_stop
18
19                 if ! getent passwd | grep -q "^${_USERNAME}"
20                 then
21                         adduser --system --no-create-home --quiet --gecos 'Open ERP server' --group ${_USERNAME}
22                 else
23                         echo "Open ERP user (${_USERNAME}) already exists, doing nothing."
24                 fi
25
26                 sed -i -e "s|^process_user.*$|process_user = ${_USERNAME}|" ${CONFFILE}
27
28                 # Creating log file
29                 touch ${LOGFILE}
30                 chown ${_USERNAME}:adm ${LOGFILE}
31                 chmod 0640 ${LOGFILE}
32
33                 # Creating local storage directory
34                 mkdir -p /var/lib/openerp-server/filestore
35
36                 # Setting ownership and permissions
37                 chmod 0640 ${CONFFILE}
38                 chown ${_USERNAME}:${_USERNAME} ${CONFFILE}
39                 chown ${_USERNAME}:${_USERNAME} /var/lib/openerp-server -R
40
41                 echo
42                 echo "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
43                 echo "* Open ERP uses a PostgreSQL database to store its data. With the first *"
44                 echo "* generation of packages, you have to setup this database manually.     *"
45                 echo "* Please read /usr/share/doc/openerp-server/README.Debian how to do it. *"
46                 echo "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
47                 echo
48                 ;;
49
50         abort-upgrade|abort-remove|abort-deconfigure)
51
52                 ;;
53
54         *)
55                 echo "postinst called with unknown argument \`{$1}'" >&2
56                 exit 1
57                 ;;
58 esac
59
60 #DEBHELPER#
61
62 exit 0