postgres/install.sh

22 lines
499 B
Bash
Raw Permalink Normal View History

2024-08-31 02:26:15 +05:00
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo -e "\033[31mThis script requires superuser rights.\033[0m"
exit 0
fi
trap 'echo -e "\033[31minstall.sh: Something went wrong\033[0m"; exit 1' ERR
set -e
export DEBIAN_FRONTEND=noninteractive
echo "Install postgres..."
cd /data/utils
bash global-env.sh POSTGRES_USER admin
bash global-env.sh POSTGRES_DB postgres
sudo bash env-gen.sh POSTGRES_PASSWORD
cd /data/postgres
sudo docker compose up -d
trap - ERR
echo "Install postgres complete"