Revision 9090,
1.6 KB
checked in by ghudson, 28 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r9089,
which included commits to RCS files with non-trunk default branches.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[9089] | 1 | |
---|
| 2 | # Copyright (c) 1985,1987,1991 Adobe Systems Incorporated. All rights reserved. |
---|
| 3 | # GOVERNMENT END USERS: See notice of rights in Notice file in release directory. |
---|
| 4 | # PostScript is a registered trademark of Adobe Systems Incorporated |
---|
| 5 | # TranScript is a registered trademark of Adobe Systems Incorporated |
---|
| 6 | # RCSID: $Header: /afs/dev.mit.edu/source/repository/third/transcript/rmprinter.sh,v 1.1.1.1 1996-10-07 20:25:23 ghudson Exp $ |
---|
| 7 | # |
---|
| 8 | # usage: rmprinter PRINTER |
---|
| 9 | |
---|
| 10 | if [ -r ./config ] |
---|
| 11 | then |
---|
| 12 | . ./config |
---|
| 13 | else |
---|
| 14 | echo "config file missing" |
---|
| 15 | exit 1 |
---|
| 16 | fi |
---|
| 17 | |
---|
| 18 | if [ -r ./printer ] |
---|
| 19 | then |
---|
| 20 | . ./printer |
---|
| 21 | else |
---|
| 22 | echo "printer file missing" |
---|
| 23 | exit 1 |
---|
| 24 | fi |
---|
| 25 | |
---|
| 26 | if [ $OPSYS = "BSD" ] |
---|
| 27 | then |
---|
| 28 | PATH=${PATH}:/etc:/usr/etc |
---|
| 29 | export PATH |
---|
| 30 | fi |
---|
| 31 | |
---|
| 32 | PRINTER=$1 |
---|
| 33 | export PRINTER |
---|
| 34 | |
---|
| 35 | # shut down the printer |
---|
| 36 | if [ $OPSYS = "BSD" ] |
---|
| 37 | then |
---|
| 38 | lpc stop $PRINTER |
---|
| 39 | lpc disable $PRINTER |
---|
| 40 | lpc abort $PRINTER |
---|
| 41 | lprm -P$PRINTER - |
---|
| 42 | else |
---|
| 43 | /usr/lib/reject -r"printer being removed" $PRINTER |
---|
| 44 | disable -c -r"printer begin removed" $PRINTER |
---|
| 45 | cancel $PRINTER |
---|
| 46 | if [ $SOLARIS = "FALSE" ] |
---|
| 47 | then |
---|
| 48 | /usr/lib/lpshut |
---|
| 49 | fi |
---|
| 50 | /usr/lib/lpadmin -x$PRINTER |
---|
| 51 | /usr/lib/lpsched |
---|
| 52 | fi |
---|
| 53 | |
---|
| 54 | # remove the device |
---|
| 55 | rm -f /dev/${PRINTER} |
---|
| 56 | |
---|
| 57 | # remove spool, log, options, accounting files |
---|
| 58 | if [ $OPSYS = "BSD" ] |
---|
| 59 | then |
---|
| 60 | rm -rf ${LOGDIR}/${PRINTER}-log* ${ACCTDIR}/${PRINTER}.acct* |
---|
| 61 | rm -rf ${SPOOLDIR}/${PRINTER} |
---|
| 62 | else |
---|
| 63 | PDIR=${SPOOLDIR}/transcript |
---|
| 64 | export PDIR |
---|
| 65 | rm -rf ${PDIR}/${PRINTER}-log* ${PDIR}/${PRINTER}.opt |
---|
| 66 | fi |
---|
| 67 | |
---|
| 68 | # finish up |
---|
| 69 | if [ $OPSYS = "BSD" ] |
---|
| 70 | then |
---|
| 71 | echo "remove the entry for $PRINTER from /etc/printcap" |
---|
| 72 | else |
---|
| 73 | echo "$PRINTER removed - lp status is now:" |
---|
| 74 | lpstat -t |
---|
| 75 | fi |
---|
| 76 | |
---|
| 77 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.