#!/bin/bash

ls /usr/lib > /tmp/lslib
TCLHERE=`awk '/tclX/{++x} BEGIN {x=0} END {print x}' /tmp/lslib`
rm -rf /tmp/lslib
if [ $TCLHERE != "0" ]; then

if [ -e /usr/bin/tixwish ]; then
  TIXWISH=/usr/bin/tixwish
elif [ -e /usr/bin/tixwish4.1.8.0 ]; then
  TIXWISH=/usr/bin/tixwish4.1.8.0
elif [ -e /usr/bin/tixwish4.1.8.3 ]; then
  TIXWISH=/usr/bin/tixwish4.1.8.3
else
  echo "ERROR: tixwish not installed."
  echo "X-Windows must be installed to use the IML viewer."
  exit 1
fi

$TIXWISH /sbin/cpqimlview.tcl

else
  echo "ERROR: tclX not installed."
  echo "tclX must be installed to use the IML viewer."
  exit 1
fi

exit 0
