78 |
78 |
|
79 |
79 |
set_lx_office_erp_web_admin_password() {
|
80 |
80 |
|
|
81 |
if ! [ -f /etc/lx-office-erp/lx_office.conf ] ; then
|
|
82 |
cp /etc/lx-office-erp/lx_office.conf.default /etc/lx-office-erp/lx_office.conf
|
|
83 |
fi
|
81 |
84 |
db_get lx-office-erp/admin-password
|
82 |
85 |
ADMINPASSWORD="$RET"
|
83 |
86 |
|
84 |
|
cat /etc/lx-office-erp/authentication.pl.default | \
|
85 |
|
sed --expression "s/\$self->{admin_password} = 'admin';/\$self->{admin_password} = '$ADMINPASSWORD';/g" \
|
|
87 |
cat /etc/lx-office-erp/lx_office.conf | \
|
|
88 |
sed --expression "s/admin_password = /admin_password = $ADMINPASSWORD/g" \
|
86 |
89 |
> /tmp/1.txt
|
87 |
90 |
|
88 |
|
mv /tmp/1.txt /etc/lx-office-erp/authentication.pl
|
|
91 |
mv /tmp/1.txt /etc/lx-office-erp/lx_office.conf
|
89 |
92 |
|
90 |
93 |
}
|
91 |
94 |
|
92 |
95 |
|
93 |
|
set_lx_office_erp_authentication_db_password() {
|
|
96 |
set_lx_office_erp_authentication_db_user_password() {
|
94 |
97 |
db_get lx-office-erp/lx-office-erp-user-postgresql-password
|
95 |
98 |
PASSWORD="$RET"
|
96 |
99 |
|
97 |
|
cat /etc/lx-office-erp/authentication.pl | \
|
98 |
|
sed --expression "s/'password' => '',/'password' => '$PASSWORD',/g" \
|
|
100 |
cat /etc/lx-office-erp/lx_office.conf | \
|
|
101 |
sed --expression "s/^password = /password = $PASSWORD/g" \
|
99 |
102 |
> /tmp/1.txt
|
100 |
103 |
|
101 |
|
mv /tmp/1.txt /etc/lx-office-erp/authentication.pl
|
|
104 |
cat /tmp/1.txt | \
|
|
105 |
sed --expression "s/^user = postgres/user = lxoffice/g" \
|
|
106 |
> /etc/lx-office-erp/lx_office.conf
|
102 |
107 |
|
103 |
108 |
}
|
104 |
109 |
|
105 |
|
set_lx_office_erp_authentication_db_user() {
|
106 |
|
USER="lxoffice"
|
107 |
|
|
108 |
|
cat /etc/lx-office-erp/authentication.pl | \
|
109 |
|
sed --expression "s/'user' => 'postgres',/'user' => '$USER',/g" \
|
110 |
|
> /tmp/1.txt
|
111 |
|
|
112 |
|
mv /tmp/1.txt /etc/lx-office-erp/authentication.pl
|
113 |
|
}
|
114 |
110 |
|
115 |
111 |
set_user_rights() {
|
116 |
112 |
chown -R www-data:www-data /usr/lib/lx-office-erp/users
|
117 |
113 |
chown -R www-data:www-data /usr/lib/lx-office-erp/templates
|
118 |
114 |
chown www-data:www-data /etc/lx-office-erp/lx_office.conf
|
119 |
115 |
chown www-data:www-data /usr/lib/lx-office-erp/menu.ini
|
120 |
|
chown www-data:www-data /etc/lx-office-erp/authentication.pl
|
121 |
116 |
chmod 0600 /etc/lx-office-erp/lx_office.conf
|
122 |
|
chmod 0600 /etc/lx-office-erp/authentication.pl
|
123 |
117 |
}
|
124 |
118 |
|
125 |
119 |
disable_ipv6_on_lo_interface() {
|
... | ... | |
154 |
148 |
}
|
155 |
149 |
|
156 |
150 |
mk_links() {
|
157 |
|
if ! [ -f /usr/lib/lx-office-erp/config/authentication.pl ] ; then
|
158 |
|
ln -s /etc/lx-office-erp/authentication.pl /usr/lib/lx-office-erp/config/authentication.pl
|
159 |
|
fi;
|
160 |
151 |
if ! [ -f /usr/lib/lx-office-erp/config/lx_office.conf ] ; then
|
161 |
152 |
ln -s /etc/lx-office-erp/lx_office.conf /usr/lib/lx-office-erp/config/lx_office.conf
|
162 |
153 |
fi;
|
|
154 |
if ! [ -f /usr/lib/lx-office-erp/config/lx_office.conf.default ] ; then
|
|
155 |
ln -s /etc/lx-office-erp/lx_office.conf.default /usr/lib/lx-office-erp/config/lx_office.conf.default
|
|
156 |
fi;
|
|
157 |
if [ -e /etc/lx-office-erp/authentication.pl ] ; then
|
|
158 |
rm /etc/lx-office-erp/authentication.pl
|
|
159 |
fi
|
163 |
160 |
if [ -e /etc/apache2 ] ; then
|
164 |
161 |
if ! [ -f /etc/apache2/conf.d/lx-office-erp.apache2.conf ] ; then
|
165 |
162 |
ln -s /etc/lx-office-erp/lx-office-erp.apache2.conf /etc/apache2/conf.d/lx-office-erp.apache2.conf
|
... | ... | |
196 |
193 |
VER=`cat /var/www/lx-office-erp/VERSION | cut -d '.' -f2`
|
197 |
194 |
if [ $VER = '6' ]; then
|
198 |
195 |
echo " ! 2.6 !" >> /tmp/lxo-erp.log
|
199 |
|
echo "Version 2.6"
|
|
196 |
echo "Version 2.6.x"
|
200 |
197 |
mk_new_menu
|
201 |
198 |
else
|
202 |
199 |
mk_new_menu
|
203 |
200 |
mk_new_config
|
204 |
201 |
config_postgresql_factory_script
|
205 |
202 |
set_lx_office_erp_web_admin_password
|
206 |
|
set_lx_office_erp_authentication_db_user
|
207 |
|
set_lx_office_erp_authentication_db_password
|
|
203 |
set_lx_office_erp_authentication_db_user_password
|
208 |
204 |
# disable_ipv6_on_lo_interface
|
209 |
205 |
mk_links
|
210 |
206 |
fi;
|
... | ... | |
220 |
216 |
mk_new_config
|
221 |
217 |
config_postgresql_factory_script
|
222 |
218 |
set_lx_office_erp_web_admin_password
|
223 |
|
set_lx_office_erp_authentication_db_user
|
224 |
|
set_lx_office_erp_authentication_db_password
|
|
219 |
set_lx_office_erp_authentication_db_user_password
|
225 |
220 |
# disable_ipv6_on_lo_interface
|
226 |
221 |
mk_links
|
227 |
222 |
|
authentication.pl aus den Scripten raus,
lx_office.conf anlegen und anpassen