#!/bin/ksh93
#  ALTRAN_PROLOG_BEGIN_TAG                                                    
#  This is an automatically generated prolog.                                  
#                                                                              
#  Copyright (C) Altran ACT S.A.S. 2019,2021.  All rights reserved.  
#                                                                              
#  ALTRAN_PROLOG_END_TAG                                                      
#                                                                              
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/usr/sbin/cluster/sa/domino/sbin/cl_domino_server_discovery.sh 1.2 
#  
# Licensed Materials - Property of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2010 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)  7d4c34b 43haes/usr/sbin/cluster/sa/domino/sbin/cl_domino_server_discovery.sh, 726, 2147A_aha726, Feb 05 2021 09:50 PM
###############################################################################################
#
# NAME:
#       cl_domino_server_discovery
#
# PURPOSE:
#       Discovers Lotus domino server is installed or not
#
# ARGUMENTS:
#       n/a
#
# RETURNS
#  1 on success
#  0 on Failure
#
#################################################################################################

typeset version="1.0"

[[ "$VERBOSE_LOGGING" == "high" ]] && set -x

. /usr/es/sbin/cluster/sa/domino/sbin/cl_lotusdominoGlobals

function discover_domino_server {
        [[ "$VERBOSE_LOGGING" == "high" ]] && set -x

        [[ -d $DOMINO_PROG_DIR ]] && {
                                [[ -f $DOMINO_PROG_DIR/.install.dat ]] && {
										ls -l $DOMINO_PROG_DIR/notes/latest|awk -F "->" 'BEGIN {exit_status = 1}; $2 >= 85000 {exit_status = 0};END {exit exit_status}' > /dev/null 2>&1
        						                        [[ $? == 0 ]] && return 1
                        						  }
				}
        return 0
}

typeset result

discover_domino_server
result=$?
echo "Lotus Domino server Smart Assist:DOMINO:Lotus Domino server:DOMINO_SERVER:$result"
exit 0
