source: trunk/debathena/config/lprng-config/debian/get_hesiod_pcap @ 22685

Revision 22685, 1.2 KB checked in by ghudson, 17 years ago (diff)
* debathena/config: Snapshot config package sources from /mit/debathena/packages/config.
  • Property svn:executable set to *
Line 
1#!/bin/sh
2# $Id: get_hesiod_pcap.sh,v 1.3 1999/09/02 14:33:29 ghudson Exp $
3
4# Support script used by LPRng to fetch Hesiod printcap entries
5
6PATH=/bin/athena:/usr/bin:/bin:/usr/bsd
7
8read printer
9
10case "$printer" in
11all)
12    # If printer is "all", it wants a list of all available printers, the
13    # first of which will be considered the default printer. We can't get
14    # all printers, so just give the default.
15
16    if [ -z "$PRINTER" ]; then
17        host=`hostname`
18        PRINTER=`hesinfo "$host" cluster 2>/dev/null | \
19            awk '/^lpr / {print $2; exit;}'`
20        if [ -z "$PRINTER" ]; then
21            # We have no default.  Let LPRng come up with its own default.
22            exit 0
23        fi
24    fi
25    echo "all:all=$PRINTER"
26    ;;
27
28*)
29    # Otherwise just look up the printer it asked for
30    PCAP=`hesinfo "$printer" pcap 2>/dev/null`
31
32    # If the user has no tickets, and the printer supports, but does
33    # not require, Kerberos authentication, then don't attempt
34    # it. (andersk, following suggestion by jdreed)
35    if ! klist -s 2>/dev/null; then
36        PCAP=`echo "$PCAP" | sed '/ka#0/ s/:auth=kerberos5//g'`
37    fi
38
39    PCAP=`echo $PCAP | sed s/:auth=none//g`
40
41    echo "$PCAP"
42    ;;
43esac
44
45exit 0
Note: See TracBrowser for help on using the repository browser.