X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Finst_postgres_deb.sh;h=b0cf9cfe6a8794b1460b0a1eba28d2146c184e45;hb=5c49e28ba1e7b146d94bb66bf8fa7a4a5a591a49;hp=d5a31383260e764cc573f35b5ca611a6a6a48110;hpb=1e1517770b9c404844212bca84dc35b9e3bdfdbd;p=kivitendo-erp.git diff --git a/scripts/inst_postgres_deb.sh b/scripts/inst_postgres_deb.sh index d5a313832..b0cf9cfe6 100755 --- a/scripts/inst_postgres_deb.sh +++ b/scripts/inst_postgres_deb.sh @@ -2,7 +2,7 @@ # e = exit on error set -e # x = xtrace -set -x +#set -x FEHLER="Achtung!! Es hat ein Problem gegeben" ERRCNT=0 @@ -10,6 +10,7 @@ source /usr/share/debconf/confmodule #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 -` #Datei plpgsql.so suchen @@ -20,7 +21,7 @@ if [ "$POSTGRESQL#" == "#" ]; then echo Datenbank bitte manuell einrichten. exit 0 else - PLPGSQL=`dpkg -L postgresql-8.3 | grep plpgsql.so` + PLPGSQL=`dpkg -L $POSTGRESQL | grep plpgsql.so ` fi if [ "$PLPGSQL#" == "#" ]; then @@ -53,7 +54,7 @@ fi 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 echo $FEHLER - echo Datenbank Version 8x konnte erreicht werden. + echo Datenbank Version 8x konnte nicht erreicht werden. exit 0 fi @@ -97,27 +98,27 @@ if [ $cnt -eq 0 ]; then cat $PGHBA.org >> $PGHBA fi -CONFDIR=`dirname $PGHBA` +#CONFDIR=`dirname $PGHBA` #postgresql.conf anpassen, liegt vermutlich im gleichen Verzeichnis wie pg_hba.conf -if ! [ -f $CONFDIR/postgresql.conf ]; then - echo $FEHLER - echo 'postgresql.conf' nicht gefunden. - echo PostgreSQL selber konfigurieren - ERRCNT=1 -fi - -mv $CONFDIR/postgresql.conf $CONFDIR/postgresql.conf.org +#if ! [ -f $CONFDIR/postgresql.conf ]; then +# echo $FEHLER +# echo 'postgresql.conf' nicht gefunden. +# echo PostgreSQL selber konfigurieren +# ERRCNT=1 +#fi + +#mv $CONFDIR/postgresql.conf $CONFDIR/postgresql.conf.org #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 +#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 -r1 /etc/init.d/postgres* | head -1 -` +PGSQL=`ls -r1 /etc/init.d/postgres* | head -1 -` #writeln 18 1 Datenbank neu starten $PGSQL reload