#! /bin/sh
#------------------------------------------------------------------------------
# /tmp/install.sh - install script for postgresql18
#
# Creation   :  2020-11-23 dv
# Last Update:  2025-12-16 22:35:20
#
# Copyright (c) 2025 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.
#------------------------------------------------------------------------------

# set package name
package_name=postgresql18

#------------------------------------------------------------------------------
# include eisfair script library
#------------------------------------------------------------------------------
. /var/install/include/eislib

#----------------------------------------------------------------------------
# Create default config
#----------------------------------------------------------------------------
/var/install/config.d/${package_name}-update.sh

#----------------------------------------------------------------------------
# Apply current config
#----------------------------------------------------------------------------
/usr/sbin/service daemon-reload
/var/install/config.d/${package_name}.sh --quiet

#----------------------------------------------------------------------------
# Start service if enabled
#----------------------------------------------------------------------------
if /usr/sbin/service is-enabled ${package_name}
then
    /usr/sbin/service --quiet start ${package_name}
fi

#-----------------------------------------------------------------------------
# End
#-----------------------------------------------------------------------------

exit 0
