Advertisement
Larrisa

psql_bin

Mar 18th, 2023
907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.73 KB | None | 0 0
  1. #!/bin/bash
  2. # check if package is already exist or not
  3. echo "* * * *   Checking if Postgresql Already exist or not   * * * *"
  4. if [ -f /usr/bin/psql ]
  5. then
  6.    echo "PostgreSQL is already installed"
  7.    postgresql_version=`psql --version`
  8.       echo $postgresql_version
  9. else
  10. echo "* * * * * *    Installation of postgresql   * * * * * *"
  11.  
  12.   echo 'Atualizando o sistema... Whatever this means'
  13.   apt-get update -y
  14.   apt-get upgrade -y
  15.   echo ''
  16.  
  17.   echo 'Instalando...'
  18.   apt-get install postgresql-14
  19.   apt-get install postgresql-client-14
  20.   echo ''
  21.  
  22.   echo 'Verifying  status...'
  23.   systemctl status postgresql.service
  24.   echo 'Cool we done here!!!'
  25.  
  26.   postgresql_version=$(psql --version)
  27.       echo "$postgresql_version"
  28.  
  29. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement