source: trunk/third/transcript/rmprinter.sh @ 9090

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 *
Line 
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
10if [ -r ./config ]
11then
12    . ./config
13else
14    echo "config file missing"
15    exit 1
16fi
17
18if [ -r ./printer ]
19then
20    . ./printer
21else
22    echo "printer file missing"
23    exit 1
24fi
25
26if [ $OPSYS = "BSD" ]
27then
28    PATH=${PATH}:/etc:/usr/etc
29    export PATH
30fi
31
32PRINTER=$1
33export PRINTER
34
35# shut down the printer
36if [ $OPSYS = "BSD" ]
37then
38    lpc stop $PRINTER
39    lpc disable $PRINTER
40    lpc abort $PRINTER
41    lprm -P$PRINTER -
42else
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
52fi
53
54# remove the device
55rm -f /dev/${PRINTER}
56
57# remove spool, log, options, accounting files
58if [ $OPSYS = "BSD" ]
59then
60    rm -rf ${LOGDIR}/${PRINTER}-log* ${ACCTDIR}/${PRINTER}.acct*
61    rm -rf ${SPOOLDIR}/${PRINTER}
62else
63    PDIR=${SPOOLDIR}/transcript
64    export PDIR
65    rm -rf ${PDIR}/${PRINTER}-log* ${PDIR}/${PRINTER}.opt
66fi
67
68# finish up
69if [ $OPSYS = "BSD" ]
70then
71    echo "remove the entry for $PRINTER from /etc/printcap"
72else
73    echo "$PRINTER removed - lp status is now:"
74    lpstat -t
75fi
76
77exit 0
Note: See TracBrowser for help on using the repository browser.