#!/bin/sh install_postresql_packages() { pkg_add postgresql-client-14.5 postgresql-server-14.5 } configure_postgresql_service() { cat > my_configuration/postgresql/pg_hba.conf < /tmp/passwordpsql.txt su -m _postgresql -c "initdb -D /var/postgresql/data -U postgres -A md5 -E UTF8 --pwfile=/tmp/passwordpsql.txt" rm /tmp/passwordpsql.txt } install_postgresql_configurations_files(){ cp -v my_configuration/postgresql/pg_hba.conf /var/postgresql/data/pg_hba.conf } start_postgresql_service(){ rcctl start postgresql } mkdir my_configuration/postgresql/ #install_postresql_packages configure_postgresql_service install_postgresql_configurations_files start_postgresql_service