#!/usr/bin/ksh
#
sortie ()
{
	/logiciel/OpC/opcmon ESO_DRDAStatus=1
	exit 0
}

#
# main
#

LOG=/tmp/drda_adm.log

. /home/ddcs/.profile 	
status=`/usr/bin/lssrc -s'sna' |grep sna | awk '{ print $4}'` 

if [ "$status" != "actif" ]
then
	sortie 
fi
status=`/usr/bin/sna -d l  -p 'AIXTOK' |grep AIXTOK |  awk '{ print $5}'`
if [ "$status" != "Actif" ]
then
       	sortie 
fi
status=`db2 "connect to is user awtsinf using 97321044" | grep "Produit base de donnes" | awk '{ print $3}'`
if [ "$status" = "" ]
then
	 sortie
fi
db2 terminate
/logiciel/OpC/opcmon ESO_DRDAStatus=0
