#!/usr/bin/env zsh : ${PGHOST:=localhost} : ${PGUSER:=postgres} # TODO: add default postgresql port : ${pgport:=$(get-port $POSTGRESQL_PROVIDER)} : ${PGDATA:=$POSTGRESQL_ROOT} : ${dbuser:=${SERVICE_ID//\//_}} : ${dbpassfile:=${SERVICE_ROOT+$SERVICE_ROOT/password_main}} : ${dbname:=${SERVICE_ID+${SERVICE_ID//\//_}_db}} : ${command} : ${cmdparameters} : ${simulation} function usage() { cat < postgresql hostname --pgport=<...> postgresql port --pgdatadir=<...> postgresql data dir --pguser=<...> postgresql username --dbuser=<...> database username --dbpassfile=<...> database password file --dbname=<...> database name --simulation print commands command: create_user create_db create_user_and_db delete_user_and_db END } function print_create_user() { cat <