#!/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:"
/usr/fox/csa/csa_stn_save $CP | awk ' $2 == "" ' > tmp1
cat tmp1
echo "Are you REALLY sure you want to continue: y/n ?"
read answer
if test $answer = "y"
then
  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
else
   exit 1
fi
