#!/bin/sh
#----------------------------------------------------------------------------
# /var/install/bin/postgresql12-tools-pgadmin_remote - start PostgreSQL Administrator
#
# Creation:     2007-02-18  dv
# Last Update:  2023-07-23 09:11:10
#
# Copyright (c) 2024 the eisfair team, team(at)eisfair(dot)org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#----------------------------------------------------------------------------

. /var/install/include/eislib
. /etc/config.d/setup
. /etc/config.d/postgresql12

PROGNAME="/usr/bin/pg_admin.cui"
PROGARGS=""

if [ "$MENU" != "/var/install/bin/show-menu.cui" ]
then
    PROGARGS="--nocolor"
fi

$PROGNAME $PROGARGS \
   --host="localhost"                              \
   --port="${POSTGRESQL12_CONNECT_PORT}"           \
   --bin-path="/usr/bin"                           \
   --backup-path="${POSTGRESQL12_BACKUP_TARGET}"   \
   --backup-mount="${POSTGRESQL12_BACKUP_MOUNT}"   \
   --backup-umount="${POSTGRESQL12_BACKUP_UMOUNT}"

exit ${?}