###########################################################
# Created by Bill Reilly Agilent Technologies on 10/16/02 #
# Unlocks Config Manager and Sys Admin                    #
###########################################################

LOCKFILE1="/var/opt/platform7/tmp/uf07_C13.tlf"
LOCKFILE2="/var/opt/platform7/tmp/uf07_C14.tlf"

if [[ -h $LOCKFILE1 ]] ;then
  ll $LOCKFILE1
else
  echo "NOT LOCKED"
  exit
fi

if [[ -h $LOCKFILE2 ]] ;then
  ll $LOCKFILE2
else
  echo "NOT LOCKED"
  exit
fi

LNOWNER="`ll $LOCKFILE1|awk '{print $3}'`"

if [[ "$LNOWNER" != "root" ]]; then
  echo "Existing lock file is not owned by root!"
  exit
else
echo "You are about to unlock the config database"
echo "Are you sure that you want to do this ?"
read ANS
fi

if [[ "$ANS" != [Yy]* ]]
then
  echo "Action cancelled."
  exit
fi
  rm /var/opt/platform7/tmp/uf07_C13.tlf
  rm /var/opt/platform7/tmp/uf07_C14.tlf
  echo "UNLOCKED.... Now OK to use config commands"



