#
# *****************************************************************************
# *
# *	(C) Copyright 1989, 1990, 1991, 1992 Novell, Inc.
# *	All Rights Reserved.
# *
# *	This program is an unpublished copyrighted work which is proprietary
# *	to Novell, Inc. and contains confidential information that is not
# *	to be reproduced or disclosed to any other person or entity without
# *	prior written consent from Novell, Inc. in each and every instance.
# *
# *	WARNING:  Unauthorized reproduction of this program as well as
# *	unauthorized preparation of derivative works based upon the
# *	program or distribution of copies by sale, rental, lease or
# *	lending are violations of federal copyright laws and state trade
# *	secret laws, punishable by civil and criminal penalties.
# *
# ****************************************************************************
#
#! /bin/sh

if [ -f ./lprinit ]
then
   cp ./lprinit /usr/bin
   chown root /usr/bin/lprinit
   chmod 555  /usr/bin/lprinit
fi


if [ -f ./lprcfg ]
then
   cp ./lprcfg /usr/bin
   chown root /usr/bin/lprcfg
   chmod 555  /usr/bin/lprcfg
fi


if [ -f ./lpr_ip ]
then
   echo "< Please wait >"
   echo "The interface program will be copied to /usr/spool/lp/model/lpr_ip"
   cp ./lpr_ip /usr/spool/lp/model
   chown root /usr/spool/lp/model/lpr_ip
   chmod 6555 /usr/spool/lp/model/lpr_ip
else
   echo "Current directory does not contain the file : lpr_ip"
   echo "which is the interface program of Novell's LPR protocol support"
   echo "for System V printing."
   echo "Please change directory to the directory that stores this file"
   echo "before you run this script."
   echo "Sorry ! "
   exit 2
fi




if [ -f /usr/bin/lpstat.sys ]
then
   echo "This system has already been installed : "   
   echo "Novell's LPR Protocol Support for System V Printing"
   echo "System V's original /usr/bin/lpstat is /usr/bin/lpstat.sys"
   exit 0
else
   if [ -f ./lpstat ]
   then
      cp /usr/bin/lpstat /usr/bin/lpstat.sys
      cp ./lpstat /usr/bin/lpstat

      chown  root /usr/bin/lpstat
      chmod  6555 /usr/bin/lpstat
      echo "System V's original /usr/bin/lpstat has now become /usr/bin/lpstat.sys"
      echo "Successful !"
   else
      echo "Current directory does not contain the file : lpr_ip"
      echo "which is the interface program of Novell's LPR protocol support"
      echo "for System V printing."
      echo "Please change directory to the directory that stores this file"
      echo "before you run this script."
   fi
fi
