mirror of
https://github.com/casjaysdevdocker/tools
synced 2025-01-19 00:34:25 -05:00
9 lines
384 B
Bash
9 lines
384 B
Bash
|
SERVICE_USER="postgres" # execute command as another user
|
||
|
EXEC_CMD_BIN="postgres" # command to execute
|
||
|
EXEC_CMD_ARGS="-D $DATABASE_DIR" # command arguments
|
||
|
|
||
|
if [ ! -s "$DATABASE_DIR/PG_VERSION" ]; then
|
||
|
sudo -u $user initdb --username="$user" -A md5 --pwfile="${ROOT_FILE_PREFIX}/${SERVICE_NAME}_pass" -D "$DATABASE_DIR" >/dev/null
|
||
|
fi
|
||
|
chmod -f 0750 "$DATABASE_DIR"
|