Revision 9e96fa63
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
DEBIAN/DEBIAN/postinst | ||
---|---|---|
26 | 26 |
|
27 | 27 |
config_postgresql_factory_script() { |
28 | 28 |
|
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."
|
|
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."
|
|
33 | 33 |
} |
34 | 34 |
|
35 | 35 |
|
36 | 36 |
config_postgresql_accounts_sec() { |
37 | 37 |
|
38 |
POSTGRESQL_PG_HBA_CONF="/etc/postgresql/8.3/main/pg_hba.conf"
|
|
38 |
POSTGRESQL_PG_HBA_CONF="/etc/postgresql/8.3/main/pg_hba.conf"
|
|
39 | 39 |
|
40 |
echo "# added by lx-office-erp postinst-script" >> $POSTGRESQL_PG_HBA_CONF
|
|
41 |
echo "host all lx_office_erp 127.0.0.1 255.255.255.0 password" >> $POSTGRESQL_PG_HBA_CONF
|
|
40 |
echo "# added by lx-office-erp postinst-script" >> $POSTGRESQL_PG_HBA_CONF
|
|
41 |
echo "host all lx_office_erp 127.0.0.1 255.255.255.0 password" >> $POSTGRESQL_PG_HBA_CONF
|
|
42 | 42 |
|
43 |
/etc/init.d/postgresql* reload
|
|
43 |
/etc/init.d/postgresql* reload
|
|
44 | 44 |
} |
45 | 45 |
|
46 | 46 |
|
47 | 47 |
config_postgresql_roles() { |
48 | 48 |
|
49 |
echo "CREATE USER lx_office_erp with CREATEDB ;" > /tmp/lxdb-install.sql
|
|
49 |
echo "CREATE USER lx_office_erp with CREATEDB ;" > /tmp/lxdb-install.sql
|
|
50 | 50 |
|
51 | 51 |
db_get lx-office-erp/lx-office-erp-user-postgresql-password |
52 | 52 |
POSTGRES_LX_OFFICE_ERP_USER_PASSWORD="$RET" |
... | ... | |
54 | 54 |
echo "ALTER USER lx_office_erp PASSWORD '$POSTGRES_LX_OFFICE_ERP_USER_PASSWORD' ;" \ |
55 | 55 |
>> /tmp/lxdb-install.sql |
56 | 56 |
|
57 |
echo "UPDATE pg_language SET lanpltrusted = true WHERE lanname = 'plpgsql';" >> /tmp/lxdb-instal.sql
|
|
57 |
echo "UPDATE pg_language SET lanpltrusted = true WHERE lanname = 'plpgsql';" >> /tmp/lxdb-instal.sql
|
|
58 | 58 |
|
59 | 59 |
su postgres -c "psql --dbname template1 < /tmp/lxdb-install.sql" |
60 | 60 |
|
... | ... | |
65 | 65 |
|
66 | 66 |
config_postgresql_sql_routines() { |
67 | 67 |
|
68 |
PLPGSQL="/usr/lib/postgresql/8.3/lib/plpgsql.so"
|
|
69 |
echo "CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler" > /tmp/lxdb-install.sql
|
|
70 |
echo "AS '$PLPGSQL', 'plpgsql_call_handler'" >> /tmp/lxdb-install.sql
|
|
71 |
echo "LANGUAGE c;" >> /tmp/lxdb-install.sql
|
|
72 |
echo "CREATE PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler;" >> /tmp/lxdb-install.sql
|
|
73 |
su postgres -c "psql --dbname template1 < /tmp/lxdb-install.sql"
|
|
68 |
PLPGSQL="/usr/lib/postgresql/8.3/lib/plpgsql.so"
|
|
69 |
echo "CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler" > /tmp/lxdb-install.sql
|
|
70 |
echo "AS '$PLPGSQL', 'plpgsql_call_handler'" >> /tmp/lxdb-install.sql
|
|
71 |
echo "LANGUAGE c;" >> /tmp/lxdb-install.sql
|
|
72 |
echo "CREATE PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler;" >> /tmp/lxdb-install.sql
|
|
73 |
su postgres -c "psql --dbname template1 < /tmp/lxdb-install.sql"
|
|
74 | 74 |
|
75 |
/etc/init.d/postgresql-8.3 reload
|
|
75 |
/etc/init.d/postgresql-8.3 reload
|
|
76 | 76 |
} |
77 | 77 |
|
78 | 78 |
|
79 | 79 |
set_lx_office_erp_web_admin_password() { |
80 |
db_get lx-office-erp/admin-password
|
|
81 |
ADMINPASSWORD="$RET"
|
|
80 |
db_get lx-office-erp/admin-password
|
|
81 |
ADMINPASSWORD="$RET"
|
|
82 | 82 |
|
83 |
sed --in-place --expression "s/^admin_password.*=.*/admin_password = $ADMINPASSWORD/" /etc/lx-office-erp/lx_office.conf
|
|
83 |
sed --in-place --expression "s/^admin_password.*=.*/admin_password = $ADMINPASSWORD/" /etc/lx-office-erp/lx_office.conf
|
|
84 | 84 |
} |
85 | 85 |
|
86 | 86 |
|
87 | 87 |
set_lx_office_erp_authentication_db_user_password() { |
88 |
db_get lx-office-erp/lx-office-erp-user-postgresql-password
|
|
89 |
PASSWORD="$RET"
|
|
88 |
db_get lx-office-erp/lx-office-erp-user-postgresql-password
|
|
89 |
PASSWORD="$RET"
|
|
90 | 90 |
|
91 |
sed --in-place --expression "s/^password.*=.*/password = $PASSWORD/" /etc/lx-office-erp/lx_office.conf
|
|
92 |
sed --in-place --expression "s/^user.*=.*postgres/user = lxoffice/g" /etc/lx-office-erp/lx_office.conf
|
|
91 |
sed --in-place --expression "s/^password.*=.*/password = $PASSWORD/" /etc/lx-office-erp/lx_office.conf
|
|
92 |
sed --in-place --expression "s/^user.*=.*postgres/user = lxoffice/g" /etc/lx-office-erp/lx_office.conf
|
|
93 | 93 |
} |
94 | 94 |
|
95 | 95 |
|
96 | 96 |
set_user_rights() { |
97 |
chown -R www-data:www-data /usr/lib/lx-office-erp/users
|
|
98 |
chown -R www-data:www-data /usr/lib/lx-office-erp/templates
|
|
99 |
chown www-data:www-data /etc/lx-office-erp/lx_office.conf
|
|
100 |
chown www-data:www-data /usr/lib/lx-office-erp/menu.ini
|
|
101 |
chmod 0600 /etc/lx-office-erp/lx_office.conf
|
|
97 |
chown -R www-data:www-data /usr/lib/lx-office-erp/users
|
|
98 |
chown -R www-data:www-data /usr/lib/lx-office-erp/templates
|
|
99 |
chown www-data:www-data /etc/lx-office-erp/lx_office.conf
|
|
100 |
chown www-data:www-data /usr/lib/lx-office-erp/menu.ini
|
|
101 |
chmod 0600 /etc/lx-office-erp/lx_office.conf
|
|
102 | 102 |
} |
103 | 103 |
|
104 | 104 |
disable_ipv6_on_lo_interface() { |
105 | 105 |
#Ist wohl nicht mehr notwendig. |
106 |
# 2009-04-25
|
|
106 |
# 2009-04-25
|
|
107 | 107 |
# Perls Libraries are not yet ipv6 read |
108 | 108 |
echo "WICHTIG: ipv6 ist nunmehr auf dem Loopback-Interface deaktiviert, um die Funktionsfähigkeit von Lx-Office-ERP zu gewährleisten!" |
109 | 109 |
ifconfig lo inet6 del ::1/128 2> /dev/null || true |
110 | 110 |
|
111 |
# make the changes permanent (triggered on next reboot)
|
|
112 |
RCLOCAL="/etc/rc.local"
|
|
113 |
echo "# lx-office-erp: Perl libraries are not yet fully ipv6-ready" >> $RCLOCAL
|
|
114 |
echo "ifconfig lo inet6 del ::1/128" >> $RCLOCAL
|
|
111 |
# make the changes permanent (triggered on next reboot)
|
|
112 |
RCLOCAL="/etc/rc.local"
|
|
113 |
echo "# lx-office-erp: Perl libraries are not yet fully ipv6-ready" >> $RCLOCAL
|
|
114 |
echo "ifconfig lo inet6 del ::1/128" >> $RCLOCAL
|
|
115 | 115 |
|
116 | 116 |
} |
117 | 117 |
mk_new_menu() { |
... | ... | |
128 | 128 |
|
129 | 129 |
mk_new_config() { |
130 | 130 |
if ! [ -f /etc/lx-office-erp/lx_office.conf ] ; then |
131 |
cp /etc/lx-office-erp/lx_office.conf.default /etc/lx-office-erp/lx_office.conf
|
|
131 |
cp /etc/lx-office-erp/lx_office.conf.default /etc/lx-office-erp/lx_office.conf
|
|
132 | 132 |
fi |
133 | 133 |
} |
134 | 134 |
|
... | ... | |
147 | 147 |
ln -s /etc/lx-office-erp/lx-office-erp.cherokee /etc/cherokee/sites-available/lx-office-erp.cherokee |
148 | 148 |
fi; |
149 | 149 |
fi; |
150 |
if [ -e /etc/lighttpd ] ; then
|
|
150 |
if [ -e /etc/lighttpd ] ; then |
|
151 | 151 |
if ! [ -f /etc/lighttpd/conf-enabled/lx-office-erp.lighttpd ] ; then |
152 | 152 |
ln -s /etc/lx-office-erp/lx-office-erp.lighttpd /etc/lighttpf/conf-enabled/10-lx-office-erp |
153 | 153 |
fi; |
... | ... | |
160 | 160 |
if [ -f /etc/init.d/cherokee ] ; then |
161 | 161 |
/etc/init.d/cherokee reload |
162 | 162 |
fi |
163 |
if [ -f /etc/init.d/lighttpd ] ; then
|
|
163 |
if [ -f /etc/init.d/lighttpd ] ; then |
|
164 | 164 |
/etc/init.d/lighttpd reload |
165 | 165 |
fi |
166 | 166 |
} |
... | ... | |
180 | 180 |
config_postgresql_factory_script |
181 | 181 |
set_lx_office_erp_web_admin_password |
182 | 182 |
set_lx_office_erp_authentication_db_user_password |
183 |
# disable_ipv6_on_lo_interface
|
|
183 |
# disable_ipv6_on_lo_interface
|
|
184 | 184 |
mk_links |
185 | 185 |
fi; |
186 | 186 |
|
Auch abrufbar als: Unified diff
Kosmetik: keine Tabs oder trailing whitespaces