Advertisement
Guest User

Install PostgreSQL Server Ubuntu 12.04

a guest
Mar 27th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.32 KB | None | 0 0
  1. #!/bin/bash
  2. ################################################################################
  3. # Script for Installation: OpenERP 7.0 server on Ubuntu 12.04 LTS
  4. # Author: André Schenkels, ICTSTUDIO 2013
  5. #-------------------------------------------------------------------------------
  6. #  
  7. # This script will install OpenERP Server with PostgreSQL server 9.2 on
  8. # clean Ubuntu 12.04 Server
  9. #-------------------------------------------------------------------------------
  10. # USAGE:
  11. #
  12. # oe-install
  13. #
  14. # EXAMPLE:
  15. # oe-install
  16. #
  17. ################################################################################
  18.  
  19. ##fixed parameters
  20. #openerp
  21. OE_USER="openerp"
  22. OE_HOME="/opt/openerp"
  23.  
  24. #Enter version for checkout "/6.1" for version 6.1, "/7.0" for version 7.0 and "" for trunk
  25. OE_VERSION="/7.0"
  26.  
  27. #set bazaar parameters
  28.  
  29. #BZR_LATEST will use the current version
  30. BZR_LATEST=true
  31.  
  32. #BZR_LIGHTWEIGHT will do a lightweight checkout of the code
  33. BZR_LIGHTWEIGHT=true
  34.  
  35. #Specifiy the revision you want to use if BZR_LATEST = false
  36. OE_WEB_REV="3941"
  37. OE_SERVER_REV="5004"
  38. OE_ADDONS_REV="9154"
  39.  
  40. #set the superadmin password
  41. OE_SUPERADMIN="superadminpassword"
  42. OE_CONFIG="openerp-server"
  43.  
  44. #choose postgresql version [8.4, 9.1, 9.2 or 9.3]
  45. PG_VERSION="9.2"
  46.  
  47. #--------------------------------------------------
  48. # Install PostgreSQL Server
  49. #--------------------------------------------------
  50. echo -e "\n---- Install PostgreSQL Server $PG_VERSION  ----"
  51. sudo wget -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
  52. sudo su root -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' >> /etc/apt/sources.list.d/pgdg.list"
  53. sudo su root -c "echo 'Package: *' >> /etc/apt/preferences.d/pgdg.pref"
  54. sudo su root -c "echo 'Pin: release o=apt.postgresql.org' >> /etc/apt/preferences.d/pgdg.pref"
  55. sudo su root -c "echo 'Pin-Priority: 500' >> /etc/apt/preferences.d/pgdg.pref"
  56. yes | sudo apt-get update
  57. yes | sudo apt-get install pgdg-keyring
  58. yes | sudo apt-get install postgresql-$PG_VERSION
  59.    
  60. echo -e "\n---- PostgreSQL $PG_VERSION Settings  ----"
  61. sudo sed -i s/"#listen_addresses = 'localhost'"/"listen_addresses = '*'"/g /etc/postgresql/$PG_VERSION/main/postgresql.conf
  62.  
  63. echo -e "\n---- Creating the OpenERP PostgreSQL User  ----"
  64. sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement