Changeset 5836 for trunk/INSTALL/arquivos/scripts/bd.sh
- Timestamp:
- 03/27/12 17:13:13 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/INSTALL/arquivos/scripts/bd.sh
r5818 r5836 19 19 rm -rf $DIR_PG* 20 20 su - postgres -c "export LANG=pt_BR.ISO-8859-1; initdb -E latin1 -D $DIR_PG" 21 #su - postgres -c 'env LANG=LATIN1 /usr/bin/initdb --locale=pt_BR.iso88591 --encoding=LATIN1 -D /var/lib/pgsql/data/'21 #su - postgres -c "env LANG=LATIN1 initdb --locale=pt_BR.iso88591 --encoding=LATIN1 -D $DIR_PG" 22 22 sed -e "s/LDAP_DN/$LDAP_DN/g" -e "s/LDAP_PWD/$LDAP_PWD/g" -e "s/ORG/$ORG/g" -e "s/DOMAIN/$DOMAIN/g" $ARQS/expresso.dump > /tmp/expresso.dump 23 23 24 24 25 <<<<<<< .mine 26 27 cp -f $PG_CONF $DIR_CONF/ 28 cp -f $PG_HBA $DIR_CONF/ 29 # service postgresql start 30 ======= 25 31 26 32 cp -f $PG_CONF $DIR_CONF/ 27 33 cp -f $PG_HBA $DIR_CONF/ 28 34 35 >>>>>>> .r5824 29 36 } 30 37 38 <<<<<<< .mine 39 bd_ubuntu1110 () { 40 DIR_PG=$1 41 PG_CONF=$2 42 PG_HBA=$3 43 DIR_CONF=$4 44 get_org 45 get_pass 46 47 rm -rf $DIR_PG* 48 su - postgres -c "env LANG=LATIN1 initdb --locale=pt_BR.iso88591 --encoding=LATIN1 -D $DIR_PG" 49 sed -e "s/LDAP_DN/$LDAP_DN/g" -e "s/LDAP_PWD/$LDAP_PWD/g" -e "s/ORG/$ORG/g" -e "s/DOMAIN/$DOMAIN/g" $ARQS/expresso.dump > /tmp/expresso.dump 50 51 52 53 cp -f $PG_CONF $DIR_CONF/ 54 cp -f $PG_HBA $DIR_CONF/ 55 } 56 57 58 31 59 # Cria a base de dados e importa os SQLs padroes 60 ======= 61 # Cria a base de dados e importa os SQLs padroes 62 >>>>>>> .r5824 32 63 create_db () 33 64 { … … 35 66 su - postgres -c 'createdb -E LATIN1 expresso' || { echo "Falha na criação do banco expresso."; exit 1; } 36 67 su - postgres -c 'psql -f /tmp/expresso.dump expresso' 37 #su - postgres -c 'psql < /tmp/workflow.dump -U postgres'38 68 } 39 69 … … 56 86 chmod -R 770 $DIR_PG 57 87 88 <<<<<<< .mine 89 bd $DIR_PG $PG_CONF $PG_HBA $DIR_CONF 90 rm -f $DIR_PG/postgresql.conf 91 rm -f $DIR_PG/pg_hba.conf 92 ======= 58 93 bd $DIR_PG $PG_CONF $PG_HBA $DIR_CONF 59 94 rm -f $DIR_PG/postgresql.conf 60 95 rm -f $DIR_PG/pg_hba.conf 61 96 97 >>>>>>> .r5824 62 98 /etc/init.d/postgresql start 63 99 … … 72 108 SQUEEZE=debian/squeeze/$DIR_CONF 73 109 bd_debian $DIR_PG $SQUEEZE/postgresql.conf $SQUEEZE/pg_hba.conf $DIR_CONF 110 } 111 112 bd_ubuntu () 113 { 114 DIR_PG="$1" 115 PG_CONF="$2" 116 PG_HBA="$3" 117 DIR_CONF="$4" 118 # Instala os pacotes do servico 119 apt-get install -y postgresql postgresql-common postgresql-client postgresql-client-common 120 /etc/init.d/postgresql stop 121 # Gera um link do initdb, para padronizar com o Centos 122 ln -sf /usr/lib/postgresql/9.1/bin/initdb /usr/bin/ 123 # Faz backup da base do Postgres 124 mv $DIR_PG $DIR_PG.`date +"%s"` 125 126 mkdir -p $DIR_PG/main 127 chown -R postgres:postgres $DIR_PG 128 chmod -R 770 $DIR_PG 129 130 bd_ubuntu1110 $DIR_PG $PG_CONF $PG_HBA $DIR_CONF 131 #rm -f $DIR_PG/postgresql.conf 132 #rm -f $DIR_PG/pg_hba.conf 133 /etc/init.d/postgresql start 134 135 # Inicializa a base de dados do Expresso 136 create_db 137 } 138 139 140 bd_ubuntu-11.10 () 141 { 142 DIR_PG="/var/lib/postgresql/9.1/main" 143 DIR_CONF="/etc/postgresql/9.1/main" 144 UBUNTU=ubuntu/11.10/$DIR_CONF 145 bd_ubuntu $DIR_PG $UBUNTU/postgresql.conf $UBUNTU/pg_hba.conf $DIR_CONF 74 146 } 75 147
Note: See TracChangeset
for help on using the changeset viewer.