#!/usr/bin/env bash config() { if [ "$(whoami)" = "root" ] then echo "It is not recommended to run this script as root. As a normal user, elevation will be prompted if needed." read -rp "Continue anyway? (Y/n) " confirm /dev/null then echo "PostgreSQL does not seems to be installed in $PG_PATH" read -rep "Please specify the PostgreSQL data folder: " PG_PATH "$FM_PATH/.awktmpfile" && mv "$FM_PATH/.awktmpfile" "$FM_PATH/docker-compose.yml" } trust_pg_hba_conf() { if [ "$(whoami)" = "root" ]; then COMMAND="tee" else COMMAND="sudo tee"; fi { echo echo "host all all all trust" } | "$COMMAND" -a "$NEW_PATH/pg_hba.conf" > /dev/null } docker_up() { docker-compose pull docker-compose up -d } clean() { read -rp "Remove the previous PostgreSQL data folder? (y/N) " confirm