HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: //opt/perf/bin/xglance
#!/bin/sh
#==============================================================================
# @(#)xglance script 11.00.011           				    =*=
#==============================================================================

Check_Dep() {

        EXIT_STATUS=0

        LIST=`/usr/lib/rpm/find-requires << EOF
        $XGLANCE
EOF`

        for i in $LIST
        do
                rpm -q --whatprovides $i > /dev/null 2>&1
                if [ $? -ne 0 ]
                then
                    if [ `uname -s` = "Linux" ] && [ ${i:0:10} = "libXm.so.3" ]; then
                        if [ `uname -m` = "x86" ] ; then
                               if  [ ! -L /opt/perf/lib/libXm.so.3 ] ; then
                                       LIB_NOT_FOUND="$i $LIB_NOT_FOUND"
                                       EXIT_STATUS=1
                               else
                                    if [ ! -f  `readlink  /opt/perf/lib/libXm.so.3` ]; then
                                       LIB_NOT_FOUND="$i $LIB_NOT_FOUND"
                                       EXIT_STATUS=1
                                    fi
                               fi
                        else
                               if [ `uname -m` = "ppc64" ] || [ `uname -m` = "x86_64" ]; then
                                    if  [ ! -L /opt/perf/lib64/libXm.so.3 ] ; then
                                            LIB_NOT_FOUND="$i $LIB_NOT_FOUND"
                                            EXIT_STATUS=1
                                    else 
                                         if [ ! -f  `readlink  /opt/perf/lib64/libXm.so.3` ]; then
                                            LIB_NOT_FOUND="$i $LIB_NOT_FOUND"
                                            EXIT_STATUS=1
                                         fi 
                                    fi
                               fi
                        fi
                    else
                        LIB_NOT_FOUND="$i $LIB_NOT_FOUND"
                        EXIT_STATUS=1
                    fi

                fi
        done

        if [ $EXIT_STATUS -ne 0 ]
        then
                echo "ERROR:   The following dependencies have not been met for $XGLANCE"
                echo "         $LIB_NOT_FOUND"
        fi

        return $EXIT_STATUS
}

Launch_Xglance() {

        if [ "$LAUNCH_XGLANCE" = "YES" ]
        then
                exec $XGLANCE ${1+"$@"}
        fi
}

#==============================================================================
#       MAIN
#==============================================================================

LAUNCH_XGLANCE="YES"
XGLANCE="/opt/perf/bin/xglance-bin"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/perf/lib64

#
# Do not launch the xglance-bin binary if the -check option is passed
#

if [ "$1" = "-check" ]
then
        LAUNCH_XGLANCE=NO
fi

if [ ! -x $XGLANCE ]
then
        echo "ERROR:   $XGLANCE not found"
        exit 1
fi

#
# Check for the dependencies first, and launch xglance-bin
# if -check option is not passed
#

if Check_Dep
then
        Launch_Xglance $*
else
        exit 1
fi