#!/bin/sh

########################################################################
#
#       Licensed Materials - Property of IBM
#
#       (C) Copyright IBM Corp. 1994-2015. All Rights Reserved
#
#       US Government Users Restricted Rights - Use, duplication
#       or disclosure restricted by GSA ADP Schedule Contract
#       with IBM Corp.
#
#       ========================================================
#       Module Information:
#
#       DESCRIPTION:
#       nco_pprobe
#
#########################################################################

#######################################
# Find nco_common
NCO_COMMON=`dirname $0`/../bin/nco_common

# Check for nco_common, and load if found
if [ ! -f "$NCO_COMMON" ]; then
        echo "Cannot find nco_common" 1>&2
        exit 1
fi
. $NCO_COMMON

#
# environment variables that this shell script sets/changes:
#
export OMNIHOME OMNISERVER OMNIUSER OMNIPASSWD

#
# What program are we attempting to run ?
#
PROGRAM=`basename $0`

#
# Check the script name - if nco_probe is being run as itself it does nothing
#
if [ $PROGRAM = nco_pprobe ]; then
	exit 0
fi

#
# Can we run this probe ?
#
if [ ! -f $OMNIHOME/probes/perl/$PROGRAM.pl ]; then
	err "Not installed for perl"
fi

#
# Execute probe
#
exec $OMNIHOME/probes/nco_p_nonnative perl -I$OMNIHOME/probes/perl $OMNIHOME/probes/perl/$PROGRAM.pl "$@"
