/etc/lx-office-erp/lx-office-erp.apache2.conf
/etc/lx-office-erp/lx-office-erp.cherokee
/etc/lx-office-erp/lx-office-erp.cherokee.handler
+/etc/lx-office-erp/lx-erp.conf.default
+/etc/lx-office-erp/console.conf.default
+/etc/lx-office-erp/authentication.pl.default
Priority: optional
Installed-Size: 0
Maintainer: Holger Lindemann <hli@lx-system.de>, Adrian Weibel <adrian_weibel@web.de>
-Depends: patch, apache2 | apache | lighttpd, postgresql | postgresql-8.2 | postgresql-8.3 | postgresql-8.4, libdbi-perl, libdbd-pg-perl, libpg-perl, libarchive-zip-perl, libyaml-perl, libio-stringy-perl, libtemplate-perl, libpdf-api2-perl, libcgi-ajax-perl, liblist-moreutils-perl, libxml-writer-perl, libtext-csv-xs-perl | libtext-csv-perl, liburi-perl, libdatetime-perl, libtext-iconv-perl, libclass-accessor-perl,libemail-address-perl,libparent-perl
-Suggests: tetex-base, tetex-bin, tetex-extra, xpdf | evince | okular, libfcgi-perl, libapache2-mod-fastcgi
+Depends: patch, apache2 | apache | lighttpd, postgresql-8.2 | postgresql-8.3 | postgresql-8.4, libdbi-perl, libdbd-pg-perl, libpg-perl, libarchive-zip-perl, libyaml-perl, libio-stringy-perl, libtemplate-perl, libpdf-api2-perl, libcgi-ajax-perl, liblist-moreutils-perl, libxml-writer-perl, libtext-csv-xs-perl | libtext-csv-perl, liburi-perl, libdatetime-perl, libtext-iconv-perl, libclass-accessor-perl,libemail-address-perl,libparent-perl, librose-object-perl, librose-db-perl, librose-db-object-perl
+Suggests: tetex-base | texlive-latex-base, tetex-bin | texlive-base-bin , tetex-extra | texlive-latex-extra, xpdf | evince | okular, libfcgi-perl, libapache2-mod-fastcgi
Homepage: http://www.lx-office.org
Description: Extended double entry accounting system for the german market.
Lx-Office is derived from sql-ledger and rewritten
db_get lx-office-erp/admin-password
ADMINPASSWORD="$RET"
- #cat /usr/lib/lx-office-erp/config/authentication.pl.default | \
cat /etc/lx-office-erp/authentication.pl.default | \
sed --expression "s/\$self->{admin_password} = 'admin';/\$self->{admin_password} = '$ADMINPASSWORD';/g" \
> /tmp/1.txt
- #mv /tmp/1.txt /usr/lib/lx-office-erp/config/authentication.pl
mv /tmp/1.txt /etc/lx-office-erp/authentication.pl
- #chmod 0600 /usr/lib/lx-office-erp/config/authentication.pl
- #chown www-data:www-data /usr/lib/lx-office-erp/config/authentication.pl
-
}
db_get lx-office-erp/lx-office-erp-user-postgresql-password
PASSWORD="$RET"
- #cat /usr/lib/lx-office-erp/config/authentication.pl | \
cat /etc/lx-office-erp/authentication.pl | \
sed --expression "s/'password' => '',/'password' => '$PASSWORD',/g" \
> /tmp/1.txt
- #mv /tmp/1.txt /usr/lib/lx-office-erp/config/authentication.pl
mv /tmp/1.txt /etc/lx-office-erp/authentication.pl
}
set_lx_office_erp_authentication_db_user() {
USER="lxoffice"
- #cat /usr/lib/lx-office-erp/config/authentication.pl | \
cat /etc/lx-office-erp/authentication.pl | \
sed --expression "s/'user' => 'postgres',/'user' => '$USER',/g" \
> /tmp/1.txt
- #mv /tmp/1.txt /usr/lib/lx-office-erp/config/authentication.pl
mv /tmp/1.txt /etc/lx-office-erp/authentication.pl
}
set_user_rights() {
chown -R www-data:www-data /usr/lib/lx-office-erp/users
chown -R www-data:www-data /usr/lib/lx-office-erp/templates
- chown www-data:www-data /etc/lx-office-erp/lx-erp.conf
- chown www-data:www-data /usr/lib/lx-office-erp/menu.ini
- chown www-data:www-data /etc/lx-office-erp/authentication.pl
- chmod 0600 /etc/lx-office-erp/lx-erp.conf
- chmod 0600 /etc/lx-office-erp/authentication.pl
+ chown www-data:www-data /etc/lx-office-erp/lx-erp.conf
+ chown www-data:www-data /usr/lib/lx-office-erp/menu.ini
+ chown www-data:www-data /etc/lx-office-erp/authentication.pl
+ chmod 0600 /etc/lx-office-erp/lx-erp.conf
+ chmod 0600 /etc/lx-office-erp/authentication.pl
}
disable_ipv6_on_lo_interface() {
if ! [ -f /etc/lx-office-erp/lx-erp.conf ] ; then
cp /etc/lx-office-erp/lx-erp.conf.default /etc/lx-office-erp/lx-erp.conf
fi
+ if ! [ -f /etc/lx-office-erp/console.conf ] ; then
+ cp /etc/lx-office-erp/console.conf.default /etc/lx-office-erp/console.conf
+ fi
}
mk_links() {
if ! [ -f /usr/lib/lx-office-erp/config/lx-erp.conf ] ; then
ln -s /etc/lx-office-erp/lx-erp.conf /usr/lib/lx-office-erp/config/lx-erp.conf
fi;
+ if ! [ -f /usr/lib/lx-office-erp/config/console.conf ] ; then
+ ln -s /etc/lx-office-erp/console.conf /usr/lib/lx-office-erp/config/console.conf
+ fi;
if [ -e /etc/apache2 ] ; then
if ! [ -f /etc/apache2/conf.d/lx-office-erp.apache2.conf ] ; then
ln -s /etc/lx-office-erp/lx-office-erp.apache2.conf /etc/apache2/conf.d/lx-office-erp.apache2.conf
#Nur für das Update von einer 2.6.0 nötig, da hier gnadenlos gelöscht wird
set -e
echo " ! "`date`" Preinst $1 !" >> /tmp/lxo-erp.log
+
if [ "$1" = "upgrade" ]; then
- echo "#!/bin/sh" > /var/lib/dpkg/info/lx-office-erp.postrm
- echo "set -e" >> /var/lib/dpkg/info/lx-office-erp.postrm
- echo "echo ' ! '`date`' postrm2 $1 !'" >> /var/lib/dpkg/info/lx-office-erp.postrm
- chmod +x /var/lib/dpkg/info/lx-office-erp.postrm
+ cnt=`grep -c '\-e /usr/lib/lx-office-erp' /var/lib/dpkg/info/lx-office-erp.postrm`
+ if ! [ $cnt == 0 ]; then
+ echo "#!/bin/sh" > /var/lib/dpkg/info/lx-office-erp.postrm
+ echo "set -e" >> /var/lib/dpkg/info/lx-office-erp.postrm
+ echo "echo ' ! '`date`' postrm2 $1 !'" >> /var/lib/dpkg/info/lx-office-erp.postrm
+ chmod +x /var/lib/dpkg/info/lx-office-erp.postrm
+ fi
fi
+++ /dev/null
-#!/bin/sh
-#
-## shell script for lx-office-erp to start the login manager in a browser
-
-set -e
-
-/usr/bin/sensible-browser http://localhost/lx-office-erp/login.pl
-
-
+++ /dev/null
-AddHandler cgi-script .pl
-Alias /lx-office /usr/lib/lx-office-erp/
-Alias /lx-office-erp /usr/lib/lx-office-erp/
-
-<Directory /usr/lib/lx-office-erp>
- Options ExecCGI Includes FollowSymlinks
- DirectoryIndex login.pl
- AddDefaultCharset UTF-8
-</Directory>
-
-<Directory /usr/lib/lx-office-erp/users>
- Order Deny,Allow
- Deny from All
-</Directory>
\ No newline at end of file
+++ /dev/null
-##
-## Virtual server for lx-office-erp
-##
-Directory /lx-office-erp {
- Handler common
- DocumentRoot /usr/lib/lx-office-erp/
-}
-Directory /lx-office-erp/image {
- DocumentRoot /usr/share/lx-office-erp/
-}
-Directory /lx-office-erp/css{
- DocumentRoot /var/lib/lx-office-erp/css
-}
-Directory /lx-office-erp/templates{
- DocumentRoot /var/lib/lx-office-erp/templates
-}
-Directory /lx-office-erp/users{
- DocumentRoot /var/lib/lx-office-erp/users
-}
-Directory /lx-office-erp/webdav{
- DocumentRoot /var/lib/lx-office-erp/webdav
-}
-Directory /lx-office-erp/spool{
- DocumentRoot /var/lib/lx-office-erp/spool
-}
+++ /dev/null
-Extension pl {
- Handler cgi
-}
NR="0"
#hier wurde das Git-Paket entpakt:
-SRC=/tmp/deb_test/unstable
+SRC=/tmp/lx-office-erp
#hier wird das Debian-Paket gebaut:
-DST=/tmp/deb_test/package
+DST=/tmp/package
################################################
VER=`cat VERSION`
DEST=$DST/lx-office-erp_$VER-$NR-all
-FILES='
-usr/lib/lx-office-erp/
-usr/share/lx-office-erp/
-usr/share/doc/lx-office-erp/
-var/lib/lx-office-erp/spool/
-var/lib/lx-office-erp/users/
-var/lib/lx-office-erp/css/
-var/lib/lx-office-erp/xslt/
-var/lib/lx-office-erp/templates/
-var/lib/lx-office-erp/webdav/lieferantenbestellungen/
-var/lib/lx-office-erp/webdav/anfragen/
-var/lib/lx-office-erp/webdav/gutschriften/
-var/lib/lx-office-erp/webdav/einkaufsrechnungen/
-var/lib/lx-office-erp/webdav/rechnungen/
-var/lib/lx-office-erp/webdav/bestellungen/
-var/lib/lx-office-erp/webdav/angebote/
-usr/lib/lx-office-erp/
-usr/share/lx-office-erp/
-usr/share/doc/lx-office-erp/
-usr/share/man/man1/:lx-office-erp.1.gz
-etc/lx-office-erp/:lx-office-erp.cherokee.handler
-etc/lx-office-erp/:lx-office-erp.apache2.conf
-etc/lx-office-erp/:lx-office-erp.cherokee
-usr/bin/:lx-office-erp
-'
-
-for filespec in $FILES; do
- set - `echo $filespec | sed -e 's/:/ /g'`
- dir=$1
- file=$2
- mkdir -p $SRC/DEBIAN/$dir
- if [ -f $SRC/DEBIAN/files/$file ]; then
- cp $SRC/DEBIAN/files/$file $SRC/DEBIAN/$dir/$file
- else
- echo '1' > $SRC/DEBIAN/$dir/.dummy
- fi
-done
-
-SYMLINKS='
-css:/var/lib/lx-office-erp/css
-doc:/usr/share/doc/lx-office-erp/
-image:/usr/share/lx-office-erp
-spool:/var/lib/lx-office-erp/spool
-templates:/var/lib/lx-office-erp/templates
-users:/var/lib/lx-office-erp/users/
-webdav:/var/lib/lx-office-erp/webdav
-xslt:/var/lib/lx-office-erp/xslt
-'
-
-for symspec in $SYMLINKS; do
- set - `echo $symspec | sed -e 's/:/ /g'`
- src=$1
- tar=$2
-
- ln -s $tar $SRC/DEBIAN/usr/lib/lx-office-erp/$src
-done
-#fertig
mkdir -p $DEST
cd $DEST
#Struktur anlegen:
-cp -a $SRC/DEBIAN/* .
-rm ./mk*.sh
+cp -a $SRC/DEBIAN/DEBIAN .
+tar xzf $SRC/DEBIAN/struktur.tgz
#Dateien kopieren:
#aber keine fertigen Konfigurationen, nur *.default
cp $SRC/VERSION usr/lib/lx-office-erp
cp $SRC/index.html usr/lib/lx-office-erp
cp $SRC/config/lx-erp.conf etc/lx-office-erp/lx-erp.conf.default
+cp $SRC/config/console.conf.default etc/lx-office-erp/
cp $SRC/config/authentication.pl.default etc/lx-office-erp/
cp $SRC/menu.ini usr/lib/lx-office-erp/menu.default
cp -a $SRC/css var/lib/lx-office-erp
PLPGSQL=""
#Datei plpgsql.so suchen
-#Mit Paketmanager (RPM oder APT) suchen
-#PLPGSQL=`dpkg -L postgresql | grep plpgsql.so`
+POSTGRESQL=`dpkg -l | grep -E "postgresql-[0-9]" | cut -d" " -f3 | sort -r | head -1 -`
+
+#Mit Paketmanager (Apt) suchen
+if [ "$POSTGRESQL#" == "#" ]; then
+ writeln 1 1 $FEHLER
+ writeln 2 1 Keine PostgreSQL mit Paketmanager installiert
+ writeln 3 1 Datenbank bitte manuell einrichten.
+ exit 0
+else
+ PLPGSQL=`dpkg -L postgresql-8.3 | grep plpgsql.so`
+fi
+
+#Mit Paketmanager (RPM) suchen ?
#PLPGSQL=`rpm -q --list postgres | grep plpgsql.so`
if [ "$PLPGSQL#" == "#" ]; then
#Probleme mit Paketmanager, dann zunaechst mit locate, geht schneller
+ updatedb
writeln 3 3 --locate
tmp=`locate plpgsql.so 2>/dev/null`
PLPGSQL=`echo $tmp | cut -d " " -f 1`
tput rmso
exit 1
fi
-v7=`su postgres -c "echo 'select version()' | psql template1 2>/dev/null | grep -E "[Ss][Qq][Ll][[:space:]]+7\.[0-9]\.[0-9]" | wc -l"`
-v8=`su postgres -c "echo 'select version()' | psql template1 2>/dev/null | grep -E "[Ss][Qq][Ll][[:space:]]+8\.[0-9]\.[0-9]" | wc -l"`
-#cnt=`echo $v7 + $v8 | bc -l`
+v8=`su postgres -c "echo 'select version()' | psql template1 2>/dev/null | grep -E "[Ss][Qq][Ll][[:space:]]+8\.[2-9]\.[0-9]" | wc -l"`
if [ $v8 -eq 0 ]; then
- if [ $v7 -eq 0 ]; then
- tput bel
- tput bold
- echo User postgres konnte die Datenbank nicht ansprechen
- tput rmso
- exit 1;
- else
- tput clear
- writeln 1 1 Datenbank Version 7x konnte erreicht werden.
- fi
+ tput bel
+ tput bold
+ echo User postgres konnte die Datenbank 8.2.x - 8.9.x nicht ansprechen
+ tput rmso
+ exit 1;
else
tput clear
- writeln 1 1 Datenbank Version 8x konnte erreicht werden.
+ writeln 1 1 Datenbank Version 8.2.x - 8.9.x konnte erreicht werden.
fi
echo "CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler" > lxdbinst.sql
writeln 12 1 Datenbankberechtigung einrichten
#wo ist die pg_hba.conf
writeln 13 3 --find erst /etc dann /var/lib
-tmp=`find /etc -name pg_hba.conf -type f`
+tmp=`find /etc/postgresql -name pg_hba.conf -type f`
[ "$tmp#" == "#" ] && tmp=`find /var/lib -name pg_hba.conf -type f`
PGHBA=`echo $tmp | cut -d " " -f 1`
fi
mv $CONFDIR/postgresql.conf $CONFDIR/postgresql.conf.org
-if ! [ $v7 -eq 0 ]; then
- #Nur bei der V7.x: tcpip_socket = true
- sed 's/^.*tcpip_socket.*/tcpip_socket = true/i' $CONFDIR/postgresql.conf.org > $CONFDIR/postgresql.conf
- cnt=`grep tcpip_socket $CONFDIR/postgresql.conf | wc -l`
- if [ $cnt -eq 0 ]; then
- cp $CONFDIR/postgresql.conf.org $CONFDIR/postgresql.conf
- echo "tcpip_socket = true" >> $CONFDIR/postgresql.conf
- fi
-else
- #Bei der V8.x OID einschalten.
- sed 's/^.*default_with_oids.*/default_with_oids = true/i' $CONFDIR/postgresql.conf.org > $CONFDIR/postgresql.conf
- cnt=`grep default_with_oids $CONFDIR/postgresql.conf | wc -l`
- if [ $cnt -eq 0 ]; then
- cp $CONFDIR/postgresql.conf.org $CONFDIR/postgresql.conf
- echo "default_with_oids = true" >> $CONFDIR/postgresql.conf
- fi
+#Bei der V8.x OID einschalten.
+sed 's/^.*default_with_oids.*/default_with_oids = true/i' $CONFDIR/postgresql.conf.org > $CONFDIR/postgresql.conf
+cnt=`grep default_with_oids $CONFDIR/postgresql.conf | wc -l`
+if [ $cnt -eq 0 ]; then
+ cp $CONFDIR/postgresql.conf.org $CONFDIR/postgresql.conf
+ echo "default_with_oids = true" >> $CONFDIR/postgresql.conf
fi
-tmp=`ls /etc/init.d/postgres*`
+tmp=`ls -r1 /etc/init.d/postgres*`
PGSQL=`echo $tmp | cut -d " " -f 1`
writeln 18 1 Datenbank neu starten
#!/bin/bash
-#set -x
-
# e = exit on error
set -e
# x = xtrace
-#set -x
+set -x
+FEHLER="Achtung!! Es hat ein Problem gegeben"
+ERRCNT=0
source /usr/share/debconf/confmodule
-
-function writeln()
-{
- tput cup $1 $2 # Cursor positionieren
- tput el # Rest der Zeile löschen
- shift 2 # Parameter für die Koordinaten entfernen
- echo -n $*" " # Rest der Parameterliste ausgeben
-}
-
-#tput clear
-
#Als root anmelden
if [ `id -u` -gt 0 ]; then echo "Bitte als root anmelden"; exit 1; fi
+POSTGRESQL=`dpkg -l | grep -E "postgresql-[0-9]" | cut -d" " -f3 | sort -r | head -1 -`
-#writeln 1 1 PostgreSQL fuer Lx-Office vorbereiten
-#writeln 2 1 1. plpgsql.so suchen
-PLPGSQL=""
#Datei plpgsql.so suchen
-
-#Mit Paketmanager (RPM oder APT) suchen
-#PLPGSQL=`dpkg -L postgresql | grep plpgsql.so`
-#PLPGSQL=`rpm -q --list postgres | grep plpgsql.so`
+#Mit Paketmanager suchen
+if [ "$POSTGRESQL#" == "#" ]; then
+ echo $FEHLER
+ echo Keine PostgreSQL mit Paketmanager installiert
+ echo Datenbank bitte manuell einrichten.
+ exit 0
+else
+ PLPGSQL=`dpkg -L postgresql-8.3 | grep plpgsql.so`
+fi
if [ "$PLPGSQL#" == "#" ]; then
- #Probleme mit Paketmanager, dann zunaechst mit locate, geht schneller
-# writeln 3 3 --locate
- tmp=`locate plpgsql.so 2>/dev/null`
- PLPGSQL=`echo $tmp | cut -d " " -f 1`
+ #Probleme mit Paketmanager, dann zunaechst mit locate, geht schneller
+ updatedb
+ tmp=`locate plpgsql.so 2>/dev/null`
+ PLPGSQL=`echo $tmp | cut -d " " -f 1`
fi
if [ "$PLPGSQL#" == "#" ]; then
- #noch nicht gefunden, also mit find suchen
-# writeln 3 15 --find /usr/lib
- tmp=`find /usr/lib -name plpgsql.so -type f`
- PLPGSQL=`echo $tmp | cut -d " " -f 1`
+ #noch nicht gefunden, also mit find suchen
+ tmp=`find /usr/lib -name plpgsql.so -type f`
+ PLPGSQL=`echo $tmp | cut -d " " -f 1`
fi
if [ "$PLPGSQL#" == "#" ]; then
- while :; do
-# writeln 4 1 'plpgsql.so' nicht gefunden.
-# tput bold
-# writeln 5 1 "Bitte den Pfad eingeben: "
-# tput rmso
-# read PLPGSQL
- [ "$PLPGSQL#" != "#" ] && [ -f $PLPGSQL ] && break
- # tput bel
- done
+ echo $FEHLER
+ echo 'plpgsql.so' nicht gefunden.
+ echo Datenbank manuell einrichten.
+ exit 0
fi
-#writeln 6 1 ok. 'plpgsql.so' gefunden
#Kann der User postgres die db erreichen
cnt=`ps aux | grep postgres | wc -l`
if [ $cnt -eq 0 ]; then
-# tput bel
-# tput bold
- echo Die postgreSQL-Datebbank ist nicht gestartet!
-# tput rmso
- exit 1
+ echo $FEHLER
+ echo Die postgreSQL-Datebbank ist nicht gestartet!
+ echo Datenbank manuell einrichten.
+ exit 0
fi
-v7=`su postgres -c "echo 'select version()' | psql template1 2>/dev/null | grep -E "[Ss][Qq][Ll][[:space:]]+7\.[0-9]\.[0-9]" | wc -l"`
-v8=`su postgres -c "echo 'select version()' | psql template1 2>/dev/null | grep -E "[Ss][Qq][Ll][[:space:]]+8\.[0-9]\.[0-9]" | wc -l"`
-#cnt=`echo $v7 + $v8 | bc -l`
+
+v8=`su postgres -c "echo 'select version()' | psql template1 2>/dev/null | grep -E "[Ss][Qq][Ll][[:space:]]+8\.[2-9]\.[0-9]" | wc -l"`
if [ $v8 -eq 0 ]; then
- if [ $v7 -eq 0 ]; then
-# tput bel
-# tput bold
- echo User postgres konnte die Datenbank nicht ansprechen
-# tput rmso
- exit 1;
- else
- # do nothing
- echo ""
-
-# tput clear
-# writeln 1 1 Datenbank Version 7x konnte erreicht werden.
- fi
-else
- # do nothing
- echo ""
-# tput clear
-# writeln 1 1 Datenbank Version 8x konnte erreicht werden.
+ echo $FEHLER
+ echo Datenbank Version 8x konnte erreicht werden.
+ exit 0
fi
echo "CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler" > lxdbinst.sql
echo "CREATE PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler;" >> lxdbinst.sql
#writeln 2 1 Datenbankbenutzer einrichten
-#tput bold
-#writeln 3 1 "Bitte den Datenbank-Benutzernamen (Kleinbuchstaben) eingeben [lxoffice]: "
-#tput rmso
-#read LXOUSER
-#if [ "$LXOUSER#" == "#" ]; then LXOUSER="lxoffice"; fi
-#while :; do
-# tput bold
-# writeln 4 1 "Bitte ein Kennwort eingeben : "
-# tput rmso
-# read USRPWD
- if ! [ "$USRPWD#" == "#" ]; then break; fi
-# tput bel
-#done;
-
LXOUSER="lxoffice"
-
db_get lx-office-erp/lx-office-erp-user-postgresql-password
USRPWD="$RET"
-
echo "CREATE USER $LXOUSER with CREATEDB ;" >> lxdbinst.sql
echo "ALTER USER $LXOUSER PASSWORD '$USRPWD';" >> lxdbinst.sql
echo "UPDATE pg_language SET lanpltrusted = true WHERE lanname = 'plpgsql';" >> lxdbinst.sql
echo "Fehlermeldungen die 'already exists' enthalten koennen ignoriert werden"
-#writeln 11 1 Datenbank fuer Lx-Office vorbereitet
-
#writeln 12 1 Datenbankberechtigung einrichten
-#wo ist die pg_hba.conf
-#writeln 13 3 --find erst /etc dann /var/lib
-tmp=`find /etc -name pg_hba.conf -type f`
-[ "$tmp#" == "#" ] && tmp=`find /var/lib -name pg_hba.conf -type f`
-PGHBA=`echo $tmp | cut -d " " -f 1`
+PGHBA=`find /etc/postgresql -name pg_hba.conf -type f | sort -r | head -1 -`
+if [ "$PGHBA#" == "#" ] ; then
+ PGHBA=`find /var/lib -name pg_hba.conf -type f | sort -r | head -1 -`
+fi
if [ "$PGHBA#" == "#" ]; then
- while :; do
-# writeln 14 1 'pg_hba.conf' nicht gefunden.
-# tput bold
-# writeln 15 1 "Bitte den Pfad eingeben: "
-# tput rmso
-# read PGHBA
- [ "$PGHBA#" != "#" ] && [ -f $PGHBA ] && break
- # tput bel
- done
+ echo $FEHLER
+ echo 'pg_hba.conf' nicht gefunden.
+ echo "Berechtigungen bitte selber einrichten"
+ ERRCNT=1
fi
-#writeln 16 1 ok. 'pg_hba.conf' gefunden
cnt=`grep $LXOUSER $PGHBA | wc -l `
if [ $cnt -eq 0 ]; then
- mv $PGHBA $PGHBA.org
- echo "local all $LXOUSER password" > $PGHBA
- echo "host all $LXOUSER 127.0.0.1 255.255.255.255 password" >> $PGHBA
- cat $PGHBA.org >> $PGHBA
+ mv $PGHBA $PGHBA.org
+ echo "local all $LXOUSER password" > $PGHBA
+ echo "host all $LXOUSER 127.0.0.1 255.255.255.255 password" >> $PGHBA
+ cat $PGHBA.org >> $PGHBA
fi
CONFDIR=`dirname $PGHBA`
#postgresql.conf anpassen, liegt vermutlich im gleichen Verzeichnis wie pg_hba.conf
if ! [ -f $CONFDIR/postgresql.conf ]; then
- #doch nicht da, dann fragen
- while :; do
-# writeln 13 1 'postgresql.conf' nicht gefunden.
-# tput bold
-# writeln 14 1 "Bitte den Pfad eingeben: "
-# tput rmso
-# read PGCONF
- [ "$PGCONF#" != "#" ] && [ -f $PGCONF ] && break
- # tput bel
- done
- CONFDIR=`dirname $PGCONF`
+ echo $FEHLER
+ echo 'postgresql.conf' nicht gefunden.
+ echo PostgreSQL selber konfigurieren
+ ERRCNT=1
fi
mv $CONFDIR/postgresql.conf $CONFDIR/postgresql.conf.org
-if ! [ $v7 -eq 0 ]; then
- #Nur bei der V7.x: tcpip_socket = true
- sed 's/^.*tcpip_socket.*/tcpip_socket = true/i' $CONFDIR/postgresql.conf.org > $CONFDIR/postgresql.conf
- cnt=`grep tcpip_socket $CONFDIR/postgresql.conf | wc -l`
- if [ $cnt -eq 0 ]; then
- cp $CONFDIR/postgresql.conf.org $CONFDIR/postgresql.conf
- echo "tcpip_socket = true" >> $CONFDIR/postgresql.conf
- fi
-else
- #Bei der V8.x OID einschalten.
- sed 's/^.*default_with_oids.*/default_with_oids = true/i' $CONFDIR/postgresql.conf.org > $CONFDIR/postgresql.conf
- cnt=`grep default_with_oids $CONFDIR/postgresql.conf | wc -l`
- if [ $cnt -eq 0 ]; then
- cp $CONFDIR/postgresql.conf.org $CONFDIR/postgresql.conf
- echo "default_with_oids = true" >> $CONFDIR/postgresql.conf
- fi
+#Bei der V8.x OID einschalten.
+sed 's/^.*default_with_oids.*/default_with_oids = true/i' $CONFDIR/postgresql.conf.org > $CONFDIR/postgresql.conf
+cnt=`grep default_with_oids $CONFDIR/postgresql.conf | wc -l`
+if [ $cnt -eq 0 ]; then
+ cp $CONFDIR/postgresql.conf.org $CONFDIR/postgresql.conf
+ echo "default_with_oids = true" >> $CONFDIR/postgresql.conf
fi
-tmp=`ls /etc/init.d/postgres*`
-PGSQL=`echo $tmp | cut -d " " -f 1`
+tmp=`ls -r1 /etc/init.d/postgres* | head -1 -`
#writeln 18 1 Datenbank neu starten
$PGSQL reload
-#tput bold
-#tput smso
-#writeln 20 12 ok. Das sollte es gewesen sein.
-#tput rmso
-#tput rmso
-echo
+if [ $ERRCNT -gt 0 ]; then
+ echo $FEHLER
+ echo Das betrifft aber nicht die Lx-Office Installation
+ echo sondern die Konfiguration der Datenbank.
+ echo $POSTGRESQL , $PGHBA , $CONFDIR/postgresql.conf ??
+ sleep 10
+fi