APPENDIX E:

SCRIPTS AND FILES FROM DISKETTE K0173UW (Rev A)


FILES:

       -rwxrwxrwa      6927 Aug 11 1999 ./prt-load.51
       -rwxrwxrwa      3657 Aug 11 1999 ./prt-setup.10
       -rwxrwxrwa        15 Feb 7 1997  ./etc/printscreen.options
       -rwxrwxrwa       230 Feb 11 1997 ./etc/printscreen.printers
       -rwxrwxr-x  1 root staff 57736 Jul 8 1999 ./usr/fox/wp/bin/xwd2ps.new
	   
	   xwd2ps checksum: 1289 111

prt-load.51
- This script should be loaded on /var/tmp,, and run on any 51 station that 
  is going to do PrintScreens.

- It will ask you for: System Revision Leveel and Printer type 


IF PRINTER IS HP870/HP890/HP895, and SW version is equal or lower than 4.2.4,
  then refer to document B0193SU.

IF PRINTER IS HP1200/HP1600, and SW version is equal or lower than 4.0.x/3.x,
  then refer to document B0193SH.

IF PRINTER IS LEXMARK Optra Color 45/XEROXC20, and software is equal/lower
  than 4.2.4, then IT IS NOT SUPPORTED.


IF PRINTER = HP870/HP890/HP895 AND SW = 4.3.x/6.1.x/6.2/6.3/6.3.x:

- If files /etc/printscreen.printers and /eetc/printscreen.options, the script
  will create them. 

- It will add your printer(s) name to printtscreen.options

- If your printer description in /etc/printters is "PS PostScript", it will
  ask you to change it to "Color Script"

- It will run this command for your printerr name entered (ex: LP05)

    lpadmin -pLP05 -T hplaser -i /usr/fox/exten/standard -I simple


IF PRINTER = LEXMARK/XEROX AND SW = 4.3.x/6.1.x/6.2:

- If file /usr/fox/wp/bin/xwd2ps exists, reeplace if with new one from this
  floppy. Change mode to:  755 root staff

prt-setup.10
- This script should be run only for POSTSCCRIPT--COMM/PW configurations,
  to fix the problem of SysDef: Assigns Device type = 2 (in IIF.prm)
  instead of 10 (0a).

- Saves IIF.dat/IIF.prm and changes them wiith new values

- Syntax:

  prt-setup.10  STA_LBUG  PORT#  OLD_PnDEV            NEW_Pn_DEV
                COMM/PW   1-4/1   2/pntjet  LEXMARK45/hp1600/hp870/hp895/pntjet

- The script MUST BE RUN AGAIN IF A COMMIT  INSTALL IS DONE AGAIN!!!

- This script started as 'hp100_inst1', it  changed to be 'dev-setup',
  and now is: 'prt-setup.10'

   hp1600_inst1  --> dev-setup  -->  prt-setup.10

ASCII FILES AND CONTENTS:

See below the list of all ASCII files and their contents.

Note: The line below, from script prt-setup.10, doesn't show correctly on this html page:
ed $1 << tag 1 > tmpdev.log
The real script doesn't have spaces around 'tag 1'.


-rwxrwxrwa      6927 Aug 11 1999 ./prt-loadd.51
-rwxrwxrwa      3657 Aug 11 1999 ./prt-setuup.10
-rwxrwxrwa        15 Feb  7 1997 ./etc/prinntscreen.options
-rwxrwxrwa       230 Feb 11 1997 ./etc/prinntscreen.printers


========== ./prt-load.51 ==========


:
#   Copyright 1997, 1999 The FOXBORO Company
#  Filename:  prt-load.51
#  This loads the printscreen processing files needed to support
#  the HP870/890/895, HP1600, HP1200, Lexmark45, XeroxC20 printers.
#  This script should be run on only Solaris systems.
#  Revision History:
#  wab 15 Feb 1997 Initial
#  wab 22 Jul 1999 Upgrade for replacement printers and newer releases.
#set -x

echo "This script will load the appropriate files on your 51 Series"
echo "system to support the HP870C, HP890C, HP895C, HP1200, HP1600,"
echo "Lexmark45, XeroxC20 printers."
echo "Run this only on stations originating printscreens."
LODSEQ=0
while [ $LODSEQ = 0 ]
do
  echo "Enter the release level of your system."
  echo "3.x, 4.0.x, 4.1.x, 4.2.1, 4.2.2, 4.2.3, 4.2.4 "
  echo "4.3.x, 6.1.x, 6.2, or 6.3.   \c "
  echo " ?  \c"
  read REVLVL
  case $REVLVL
  in
    3.x)    LODSEQ=1;;
    4.0.x)  LODSEQ=1;;
    4.1.x)  LODSEQ=2;;
    4.2.1)  LODSEQ=2;;
    4.2.2)  LODSEQ=2;;
    4.2.3)  LODSEQ=3;;
    4.2.4)  LODSEQ=4;;
    4.3.x | 6.1.x)  LODSEQ=5;;
    6.2)    LODSEQ=6;;
    6.3 | 6.3.x)    LODSEQ=7;;
    *)      LODSEQ=0
            echo "  Please enter one of the listed values.";;
  esac
done
#
# Subrountine used for exit.
#
endit()
{
   echo "${0}: Done."
   exit;
}
PRTDX=0
while [ $PRTDX = 0 ]
do
  echo "Enter the printer type."
  echo "HP870, HP890, HP895, HP1200, HP1600, LEXMARK45, XEROXC20 \c"
  echo " ?  \c"
  read PRTTYP
  case $PRTTYP
  in
    [Hh][Pp]8[79][05] | [Pp][Cc][Ll]3)        PRTDX=1
                          if [ $LODSEQ -le 4 ]
                          then
                             echo "Refer to Manual B0193SU."
                             endit
                          fi;;
    [Hh][Pp]1[26]00)      PRTDX=2
                          if [ $LODSEQ -le 1 ]
                          then
                             echo "Refer to Manual B0193SH."
                          else
                             echo "This printer is supported. "
                             echo "There is no work to do."
                          fi
                          endit;;
    LEXMARK45 | [Ll]45 | XEROXC20 | [Xx]20) PRTDX=3
                          if [ $LODSEQ -le 4 ]
                          then
                             echo "This printer is not supported in "
                             echo "releases prior to v4.3."
                             endit
                          fi;;
    *)      PRTDX=0
            echo "  Please enter one of the listed values.";;
  esac
done

WDIR=`pwd`

# Check if this routine was loaded into /var/tmp as requested
# by the printer installation user document.
if [ ! \( \( $WDIR = "/var/tmp" \) -o \( $WDIR = "/usr/tmp" \) \) ]
then
   echo "${0} is not in /var/tmp."
   if [ $WDIR = "/" ]
   then
      echo "If you tarred in the diskette from root, you may have "
      echo "replaced the original files:  xwd2ps, printscreen.options "
      echo "Do you want to continue loading?  \c"
      read ANSWER
      case $ANSWER
      in
        [Yy][Ee][Ss] | [Yy]) :;;
        *) endit;;
      esac 
   fi
   cd /var/tmp
fi

#
# Subroutine to calculate index for save
# and to save current file, argument 1.
#
makesav()
{
   SAVEXT=".sav"
   SAVBASE=`basename ${1}`
   SAVPATH=`dirname ${1}`
   if [ -z $SAVPATH ] ; then SAVPATH="/usr/preserve" ; fi;
   SAVNAME=${SAVPATH}"/"${SAVBASE}${SAVEXT}
   COUNT=0
   while [ -f $SAVNAME ]
   do
      COUNT=`expr $COUNT + 1`
      SAVNAME=${SAVPATH}"/"${SAVBASE}"-"${COUNT}${SAVEXT}
   done
   cp -p ${1} ${SAVNAME};
}
#
# Load the 2 files that all 51 Series need to support PCL3 printers.
# This is done for LODSEQ>=5 and PRTDX=1.
# This must be done for at every station that originates a PCL3
# printscreen, and for every PCL3 printer logical name.
#
PCL3OPT="/etc/printscreen.options"
PCL3PRT="/etc/printscreen.printers"
if [ $PRTDX = 1 ]
then
   if [ -f $PCL3OPT -o -f $PCL3PRT ]
   then
      echo "Do you want to save a backup of the current "
      echo "    ${PCL3OPT} file?  \c"
      read ANSWER
      case $ANSWER
      in
         [Nn][Oo] | [Nn]) :;;
         *)   if [ -f $PCL3OPT ]
              then
                 makesav $PCL3OPT
              fi 
              if [ -f $PCL3PRT ]
              then
                  makesav $PCL3PRT
              fi ;;
      esac
      echo "Do you want to ADD to the current or make a NEW  "
      echo "   $PCL3OPT file?  \c"
      read ANSWER
      case $ANSWER
      in
         [Nn][Ee][Ww] | [Nn] | [Nn][Ee] ) 
               cd /
               tar xvf /dev/rfd0 ".${PCL3OPT}"
               tar xvf /dev/rfd0 ".${PCL3PRT}";;
#         Make sure there is a .printers file.  We do not add to it
#         here, but one must exist for PCL3 printscreens to work.
          *)   if [ ! -f $PCL3PRT ]
               then
                  touch $PCL3PRT
               fi;;
      esac
   else
      cd /
      tar xvf /dev/rfd0 ".${PCL3OPT}"
      tar xvf /dev/rfd0 ".${PCL3PRT}"
   fi

   ANSWER="what"
   while [ $ANSWER = "what" ]
   do
      echo "What is the logical name of the HP870/890/895 "
      echo "PCL3  printer port < LPnn > ? \c"
      read ANSWER
      case $ANSWER
      in
         LP[0-9][0-9])
            grep ${ANSWER} $PCL3OPT >/dev/null
            if [ $? = 1 ]
            then
               echo ":${ANSWER}  PCL3"  >>$PCL3OPT
            else
               echo "The printer is already in the $PCL3OPT file."
            fi
            grep ${ANSWER} /etc/printers | grep PS >/dev/null
            if [ $? = 0 ]
            then
               echo "Edit /etc/printers file and replace *PS PostScript*"
               echo "  for *Color  Script*  on the ${ANSWER} entry."
            fi
#           If the printer has a local interface, then change its type.
            lpstat -s | grep "${ANSWER}" | grep device >/dev/null
            if [ $? = 0 ]
            then
               lpadmin -p${ANSWER} -T hplaser -i /usr/fox/exten/standard -I simple
            fi
            echo "\n Enter another logical name or DONE."
            ANSWER="what";;
         [Dd][Oo][Nn][Ee] | [Ee][Nn][Dd] | [Ee][Xx][Ii][Tt]) 
            ANSWER="DONE";;
         *)
            echo "\n Logical Name is not in correct format."
            echo "  Should be    LP digit  digit   or  DONE."
            ANSWER="what";;
      esac
   done
fi
              
#
# Load the file that all 51 Series need to support  
# PostScript Level 2 emulation in Lexmark and Xerox printers.
# This is done for 7>LODSEQ>=5 and PRTDX=3.
# This must be loaded at every station which originates a printscreen  
# that is destined for a Lexmark/Xerox Postscript printer.
#
if [ $PRTDX = 3 ]
then
   XWD2PS="/usr/fox/wp/bin/xwd2ps"
   if [ -f $XWD2PS ]
   then
      makesav $XWD2PS
   fi
   cd /
   tar xvf /dev/rfd0 ".${XWD2PS}.new"
   mv ${XWD2PS}.new ${XWD2PS}
   chmod 755 ${XWD2PS}
   chown root ${XWD2PS}
   chgrp staff ${XWD2PS}
fi 
   

endit


========== ./prt-setup.10 ==========


:
#     Copyright The FOXBORO Company,  1997, 1999
# Filename:  prt-setup.10
# Device Parameter Set Up
# This routine is used to change the device parameters in the 
# IIF.dat and IIF.prm files.  This must be done to place the
# correct device type in the vrtx image for PWs and COMM10s,
# when they are using the new printer types not yet in the System
# Configurator and Software Install.
# Revision History:
# wab 15 Feb 1997 Started with hp1600_instl file. New name is dev-setup.
#                 Changed PnDEV parameter values range to (1 to 15).
# wab 15 Jul 1999 Started with dev-setup and modified it for Lexmark. 
#                 New name prt-setup.10.
#set -x

# Subroutine run to exit.
endit()
{
echo "${0}: Done"
exit;
}

# Subroutine runs when input argument has a mistake.
input_err()
{
echo "\nusage:${0} < station letterbug >  < old > < new >\n"
echo "     - station letterbug - enter the comserver or PW letterbug. "
echo "                           6 characters (in quotes if spaces needed)."
echo "     - port number       - enter the comserver port number (1-4), "
echo "                            for PW types enter the number 1.         "
echo "     - old PnDEV value   - enter pntjet, 2, or valid number."
echo "     - new PnDEV value   - enter hp1600, hp870, hp895, pntjet,"
echo "                            LEXMARK45, or valid number."
endit
}

# Subroutine to Parse PnDEV argument.
parsePD()
{
PDVAL=$1
case $PDVAL
in
   [Pp][Nn][Tt][Jj][Ee][Tt])  RETSTR="2 ";;
   [Hh][Pp]1600)       RETSTR="10";;
   [Hh][Pp]8[79][05])  RETSTR="11";;
   LEXMARK45 | [Ll]45 | XEROXC20 | [Xx]20)  RETSTR="10";;
   [Pp][Cc][Ll]1)      RETSTR="2 ";;
   [Pp][Cc][Ll]5)      RETSTR="10";;
   [Pp][Cc][Ll]3)      RETSTR="11";;
   2)                RETSTR="2 ";;
   10)               RETSTR="10";;
   11)               RETSTR="11";; 
   [1-9])            RETSTR="${1} ";;
   1[0-5])           RETSTR="${1}";;
   *)       input_err;;
esac
}

# Subroutine to calculate an index and save a file copy.
makesav()
{
SAVEXT=".sav"
SAVBASE=`basename ${1}`
SAVPATH=`dirname ${1}`
if [ -z $SAVPATH ] ; then SAVPATH="/usr/preserve" ; fi;
SAVNAME=${SAVPATH}"/"${SAVBASE}${SAVEXT}
COUNT=0
while [ -f $SAVNAME ]
do
   COUNT=`expr $COUNT + 1`
   SAVNAME=${SAVPATH}"/"${SAVBASE}"-"${COUNT}${SAVEXT}
done
cp ${1} ${SAVNAME};
}

# Subrountine to change IIF files.
install1()
{
ed $1 << tag1 >tmpdev.log 
/$2/
/$3/
$4
w
q
tag1
LAST=`tail -1l tmpdev.log`
if [ $LAST -eq "?" ]
then
   echo "${0}: ${1}: Change not made!"
else
   echo "${0}: ${1}: Changed."
fi
}

# MAIN PATH OF SCRIPT STARTS
DAT=/usr/fox/sp/IIF.dat
PRM=/usr/fox/sp/IIF.prm

# Check for passed arguments
if [ $# -ne 4 ]
then 
   input_err
fi

# Get station letterbug, port, expected PnDEV, and desired PnDEV.
LETBUG=$1
PORT=$2
OLDIN=$3
NEWIN=$4

# Generate a report of printers configured.
if [ \( $LETBUG -eq "REPORT" \) -a \( $PORT -eq 0 \) ]
then
   awk '{ if( $4 ~ /^P[0-9][A-Z]*/ ) print }' ${PRM}
   endit
fi

# Verify second argument is valid port number.   
if [ \( $PORT -gt 4 \) -o \( $PORT -lt 1 \) ]
then 
   input_err	
fi

# Identify and save software install files.
if [ -f $DAT ]
then 
   makesav $DAT 
else
   echo "${0}: IIF.dat file is not available."
   endit
fi
if [ -f $PRM ]
then 
   makesav $PRM 
else
   echo "${0}: IIF.prm file is not available."
   endit
fi

parsePD $OLDIN
OLD=$RETSTR
parsePD $NEWIN
NEW=$RETSTR

install1 $PRM $LETBUG "${LETBUG} ...... P${PORT}DEV" "s/${OLD}     /${NEW}     /"

install1 $DAT $LETBUG "${LETBUG} ...... P${PORT}DEV" "s/${OLD}     /${NEW}     /"

rm tmpdev.log
echo "This script must be run again if a Commit Install is done again."
endit


========== ./etc/printscreen.options ==========


:LPxx     PCL3


========== ./etc/printscreen.printers ==========


:HP680	PCL3 DRAFT RESOLUTION300 LANDSCAPE STD_COLORS_ONLY DELTA_RLE_COMPRESSION REAL_SCALE
:HP870  PCL3 NORMAL STD_AND_NOMINAL_COLORS DELTA_RLE_COMPRESSION
:HP870P PCL3 NORMAL PORTRAIT STD_AND_NOMINAL_COLORS DELTA_RLE_COMPRESSION

1