home *** CD-ROM | disk | FTP | other *** search
- #ident "x(#)lp:model/postscript 1.3.1.2
- # Postscript serial or parallel printer using psf filters
- #
- # The Install.unix script will use sed to replace "BINARY" with
- # the binary library directory name such as /local/bin.
- # "OPTIONS" will be replaced by the desired default
- # options - usually the page size (-g Letter) generated
- # with Install.unix.
-
- # The following parameters are passed from "lp" at print time.
-
- printer=`basename $0`
- request=$1
- name=$2
- title=$3
- copies=$4
- options=$5
- shift; shift; shift; shift; shift
-
- # Modify the following for required stty settings.
-
- stty onlcr ixon ixoff 0<&1
-
- # get the banner option from the configuration file.
- # see if the user is allowed to override the banner spec.
- # The "Banner: on" and "Banner: on:Always" can be specified by lpadmin.
- # The "Banner: off" must be manually edited into the configuration file.
-
- banner="yes"
- banopt=`sed -n 's/^Banner: *\(.*\).*$/\1/p' /usr/spool/lp/admins/lp/printers/$printer/configuration`
- mustbanner="no"
- for i in ${banopt}
- do
- case "${i}" in
-
- on) banner="yes"
- mustbanner="no"
- ;;
- on:Always) banner="yes"
- mustbanner="yes"
- ;;
- off) banner="no"
- mustbanner="no"
- ;;
- *) banner="yes"
- mustbanner="no"
- ;;
- esac
- done
-
- options=
- for i in ${option_list}
- do
- case "${i}" in
-
- nobanner)
- case "${mustbanner}" in
- yes) ;;
- *) banner="no"
- ;;
- esac
- ;;
- banner)
- banner="yes"
- ;;
- *)
- options="${options} ${i}"
- ;;
- esac;
- done
-
-
- today=`date`
-
- [ "$banner" = yes ] && {
-
- # get the machine name uname.
-
- sysid=`uname -n`
-
- # get the user name from the GCOS field in /etc/passwd
-
- user=`sed -n "s/^$name:.*:.*:.*:\(.*\):.*:.*$/\1/p" /etc/passwd`
-
- BINARY/psbanner "$name" "$user" "$request" "$printer" "$options" "$today" "$sysid" "$title" BANNER
- }
-
- # If the input text file contains %! in the first line,
- # then assume that it has already been wrapped in postscript
- # code. If the %! is missing, then filter through psf
- #
- # The "OPTIONS" are default options forced in during "Install.unix"
- # Typically, this specifies the default paper size e.g.:
- #
- # -g Letter
- #
- # The "$options" are passed by lp with -o"opions"
-
- while [ "$copies" -gt 0 ]
- do
- for file
- do
- BINARY/psdetect < "$file"
-
- case $? in
-
- 0) cat "$file" 2>&1;;
-
- 1) BINARY/psf OPTIONS $options "$file" 2>&1;;
-
- esac
- done
- copies=`expr $copies - 1`
- done
- exit 0
-