#!/bin/sh
#
#  uinh_alm
#
#  Usage:   uinh_alm CPLBUG
#
#  By: Angel Corbera, TSID1, Refinery Isla, Curacao, N.A.
#  Comments to:  corbera@rocketmail.com
#
#  Purpose:  UN-Inhibit alarms on all Compounds from CPLBUG
#
if [ $# != 1 ]
then
   echo "\n\nUsage: $0 CPLBUG\n\n"
   exit 1
fi
cd /opt/ac
CP=$1
echo "\nThis program will UN-INHIBIT ALARMS on all compounds on $CP"
echo "Are you REALLY sure you want to continue: y/n ?"
read answer
if test $answer = "y"
then
   continue
else
   exit 1
fi
echo "Retrieving Compound names from CSA files for $CP ..."
/usr/fox/csa/csa_save $CP | awk ' $2 == "" ' > tmp1
echo "... Compounds found:"
cat tmp1
for x in `cat tmp1`
do
echo "Setting CINHIB to 0 on $x ---> \c"
/opt/fox/bin/tools/omset -v -b FALSE $x.CINHIB
sleep 1
/opt/fox/bin/tools/omget $x.CINHIB
done
echo "All compounds on $CP have been UN-CINHIBited"
rm tmp1
1