Revision f13b7e71
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
DEBIAN/DEBIAN/postinst | ||
---|---|---|
28 | 28 |
|
29 | 29 |
config_postgresql_factory_script() { |
30 | 30 |
|
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."
|
|
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." |
|
35 | 35 |
} |
36 | 36 |
|
37 | 37 |
|
38 | 38 |
set_lx_office_erp_web_admin_password() { |
39 |
db_get lx-office-erp/admin-password
|
|
40 |
ADMINPASSWORD="$RET"
|
|
39 |
db_get lx-office-erp/admin-password |
|
40 |
ADMINPASSWORD="$RET" |
|
41 | 41 |
|
42 |
sed --in-place --expression "s/^admin_password.*=.*/admin_password = $ADMINPASSWORD/" /etc/lx-office-erp/lx_office.conf
|
|
42 |
sed --in-place --expression "s/^admin_password.*=.*/admin_password = $ADMINPASSWORD/" /etc/lx-office-erp/lx_office.conf |
|
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
|
46 | 46 |
set_lx_office_erp_authentication_db_user_password() { |
47 |
db_get lx-office-erp/lx-office-erp-user-postgresql-password
|
|
48 |
PASSWORD="$RET"
|
|
47 |
db_get lx-office-erp/lx-office-erp-user-postgresql-password |
|
48 |
PASSWORD="$RET" |
|
49 | 49 |
|
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
|
|
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 |
|
52 | 52 |
} |
53 | 53 |
|
54 | 54 |
|
55 | 55 |
set_user_rights() { |
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
|
|
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 |
|
61 | 61 |
} |
62 | 62 |
|
63 | 63 |
mk_new_menu() { |
64 |
if [ -e /usr/lib/lx-office-crm ] ; then
|
|
64 |
if [ -e /usr/lib/lx-office-crm ] ; then |
|
65 | 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
|
|
68 |
done;
|
|
69 |
cat /usr/lib/lx-office-erp/menu.default >> /usr/lib/lx-office-erp/menu.ini
|
|
70 |
else
|
|
71 |
cp /usr/lib/lx-office-erp/menu.default /usr/lib/lx-office-erp/menu.ini
|
|
72 |
fi
|
|
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 |
|
68 |
done; |
|
69 |
cat /usr/lib/lx-office-erp/menu.default >> /usr/lib/lx-office-erp/menu.ini |
|
70 |
else |
|
71 |
cp /usr/lib/lx-office-erp/menu.default /usr/lib/lx-office-erp/menu.ini |
|
72 |
fi |
|
73 | 73 |
} |
74 | 74 |
|
75 | 75 |
mk_new_config() { |
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
|
|
78 |
fi
|
|
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 |
|
78 |
fi |
|
79 | 79 |
} |
80 | 80 |
|
81 | 81 |
mk_links() { |
82 |
for file in lx_office.conf lx_office.conf.default ; do |
|
83 |
test -f /usr/lib/lx-office-erp/config/${file} || ln -s /etc/lx-office-erp/${file} /usr/lib/lx-office-erp/config/${file} |
|
84 |
done |
|
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 |
|
88 |
fi; |
|
82 |
for file in lx_office.conf lx_office.conf.default ; do |
|
83 |
test -f /usr/lib/lx-office-erp/config/${file} || ln -s /etc/lx-office-erp/${file} /usr/lib/lx-office-erp/config/${file} |
|
84 |
done |
|
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 |
|
89 | 88 |
fi; |
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
|
|
94 |
fi;
|
|
89 |
fi;
|
|
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
|
|
95 | 94 |
fi; |
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
|
|
99 |
fi;
|
|
95 |
fi;
|
|
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
|
|
100 | 99 |
fi; |
100 |
fi; |
|
101 | 101 |
} |
102 | 102 |
reload_web_server() { |
103 |
if [ -f /etc/init.d/apache* ] ; then
|
|
104 |
/etc/init.d/apache* reload
|
|
105 |
fi
|
|
106 |
if [ -f /etc/init.d/cherokee ] ; then
|
|
107 |
/etc/init.d/cherokee reload
|
|
108 |
fi
|
|
109 |
if [ -f /etc/init.d/lighttpd ] ; then
|
|
110 |
/etc/init.d/lighttpd reload
|
|
111 |
fi
|
|
103 |
if [ -f /etc/init.d/apache* ] ; then |
|
104 |
/etc/init.d/apache* reload |
|
105 |
fi |
|
106 |
if [ -f /etc/init.d/cherokee ] ; then |
|
107 |
/etc/init.d/cherokee reload |
|
108 |
fi |
|
109 |
if [ -f /etc/init.d/lighttpd ] ; then |
|
110 |
/etc/init.d/lighttpd reload |
|
111 |
fi |
|
112 | 112 |
} |
113 | 113 |
case "$1" in |
114 | 114 |
|
115 |
upgrade)
|
|
116 |
echo " ! "`date`" $1 !" >> $debugfile
|
|
117 |
|
|
118 |
VER=`cat /var/www/lx-office-erp/VERSION | cut -d '.' -f2`
|
|
119 |
if [ $VER = '6' ]; then
|
|
120 |
echo " ! 2.6 !" >> $debugfile
|
|
121 |
echo "Version 2.6.x"
|
|
122 |
mk_new_menu
|
|
123 |
else
|
|
124 |
mk_new_menu
|
|
125 |
mk_new_config
|
|
126 |
config_postgresql_factory_script
|
|
127 |
set_lx_office_erp_web_admin_password
|
|
128 |
set_lx_office_erp_authentication_db_user_password
|
|
129 |
mk_links
|
|
130 |
fi;
|
|
131 |
|
|
132 |
set_user_rights
|
|
133 |
reload_web_server
|
|
115 |
upgrade) |
|
116 |
echo " ! "`date`" $1 !" >> $debugfile |
|
117 |
|
|
118 |
VER=`cat /var/www/lx-office-erp/VERSION | cut -d '.' -f2` |
|
119 |
if [ $VER = '6' ]; then |
|
120 |
echo " ! 2.6 !" >> $debugfile |
|
121 |
echo "Version 2.6.x" |
|
122 |
mk_new_menu |
|
123 |
else |
|
124 |
mk_new_menu |
|
125 |
mk_new_config |
|
126 |
config_postgresql_factory_script |
|
127 |
set_lx_office_erp_web_admin_password |
|
128 |
set_lx_office_erp_authentication_db_user_password |
|
129 |
mk_links |
|
130 |
fi; |
|
131 |
|
|
132 |
set_user_rights |
|
133 |
reload_web_server |
|
134 | 134 |
;; |
135 | 135 |
|
136 |
install|configure)
|
|
137 |
echo " ! "`date`" $1 !" >> $debugfile
|
|
136 |
install|configure) |
|
137 |
echo " ! "`date`" $1 !" >> $debugfile |
|
138 | 138 |
|
139 |
mk_new_menu
|
|
140 |
mk_new_config
|
|
141 |
config_postgresql_factory_script
|
|
142 |
set_lx_office_erp_web_admin_password
|
|
143 |
set_lx_office_erp_authentication_db_user_password
|
|
144 |
mk_links
|
|
139 |
mk_new_menu |
|
140 |
mk_new_config |
|
141 |
config_postgresql_factory_script |
|
142 |
set_lx_office_erp_web_admin_password |
|
143 |
set_lx_office_erp_authentication_db_user_password |
|
144 |
mk_links |
|
145 | 145 |
|
146 |
set_user_rights
|
|
147 |
reload_web_server
|
|
146 |
set_user_rights |
|
147 |
reload_web_server |
|
148 | 148 |
|
149 | 149 |
;; |
150 | 150 |
|
151 |
abort-upgrade|abort-remove|abort-deconfigure)
|
|
151 |
abort-upgrade|abort-remove|abort-deconfigure) |
|
152 | 152 |
;; |
153 | 153 |
|
154 |
*)
|
|
155 |
echo "postinst called with unknown argument \`$1'" >&2
|
|
156 |
exit 1
|
|
154 |
*) |
|
155 |
echo "postinst called with unknown argument \`$1'" >&2 |
|
156 |
exit 1 |
|
157 | 157 |
;; |
158 | 158 |
esac |
159 | 159 |
|
Auch abrufbar als: Unified diff
Kosmetik: einheitliche Einrückung