#!/bin/sh
#
#  get_qf     (Get Quick Fixes list from all 50/51 stations)
#
#  By: A.Corbera
#
#  Notes: This script uses rexec to get remote information.
#  The 'r' commands require remote stations be defined under /.rhosts
#  You must have root permissions.
#
cd /var/tmp
ME=`uname -n`
QF="/usr/fox/sp/lastinst/QF_INFO"
echo "Are you sure /.rhosts on all stations has all host names?..."
echo "QUICK FIXES/CUSTOMS INSTALLED ON 50/51 STATIONS" > qf_list
ST50=`egrep '304|306|406|308|309|409' /usr/fox/sp/hldb | awk '{print $1}'`
echo "Stations found:"
echo $ST50
for x in $ST50
do
   echo "Retrieving QF list from $x ...\c"
   if [ $ME = $x ]
   then
      echo "\nQuick Fixes on $x:" >> qf_list
      cat -s $QF | grep -v '^-' >> qf_list
      echo " Done!"
   else
      echo "\nQuick Fixes on $x:" >> qf_list
      rexec $x /usr/bin/cat -s $QF | grep -v '^-' >> qf_list
      if [ $? != 0 ]
      then
         echo " Failed!"
      else
         echo " Done."
      fi
   fi
done
more qf_list
echo "\n    This list was saved to file: /var/tmp/qf_list\n"
echo "    Searching for a QF?:  grep <QFnumber> /var/tmp/qf_list\n"
