#!/sbin/sh
# @(#) checkinstall.sd - B.08.40
# SD installation prerequisite check
# (C) Copyright Marxmeier Software AG, 2002-2024. All rights reserved.
#
# Run by swinstall during its analysis phase to insure that
# the installation (and configuration) can be attempted.
# For example, the OS run state, running processes, or other
# prerequisite conditions beyound SD dependencies could be checked.
# It should not change the state of the system.
#
# 08.11.2022 - webdlg2
# 04.03.2024 - eloqld

# setup PATH

PATH=$SW_PATH
export PATH

rval=0

# check if any Eloquence related server process is active

ps_list="eloqsd eloqdb eloqdb32 eloqdb64 dbrepl eloqwebd2 eloqld"
for ps in $ps_list
do
   pid=$(/usr/sbin/fuser /opt/eloquence/8.4/bin/$ps 2>/dev/null)
   if [[ -n $pid ]]; then
      echo "ERROR:   Eloquence is active; $ps process running"
      rval=1
   fi
done

exit $rval
