Commit | Line | Data |
---|---|---|
edd6115f JH |
1 | ?RCS: $Id: nis.U,v 3.0.1.3 1997/02/28 16:17:38 ram Exp $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1993, Raphael Manfredi | |
4 | ?RCS: | |
5 | ?RCS: You may redistribute only under the terms of the Artistic Licence, | |
6 | ?RCS: as specified in the README file that comes with the distribution. | |
7 | ?RCS: You may reuse parts of this distribution only within the terms of | |
8 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
9 | ?RCS: of the source tree for dist 3.0. | |
10 | ?RCS: | |
11 | ?RCS: $Log: nis.U,v $ | |
12 | ?RCS: Revision 3.0.1.3 1997/02/28 16:17:38 ram | |
13 | ?RCS: patch61: ensure suitable defaults for hostcat and friends | |
14 | ?RCS: | |
15 | ?RCS: Revision 3.0.1.2 1995/03/21 08:48:34 ram | |
16 | ?RCS: patch52: continued fix for NeXT NIS/NetInfo handling | |
17 | ?RCS: | |
18 | ?RCS: Revision 3.0.1.1 1995/02/15 14:16:23 ram | |
19 | ?RCS: patch51: now correctly handles NeXT using NIS rather than NetInfo | |
20 | ?RCS: | |
21 | ?RCS: Revision 3.0 1993/08/18 12:09:24 ram | |
22 | ?RCS: Baseline for dist 3.0 netwide release. | |
23 | ?RCS: | |
24 | ?MAKE:passcat groupcat hostcat: Myread Oldconfig test contains | |
25 | ?MAKE: -pick add $@ %< | |
26 | ?S:passcat: | |
27 | ?S: This variable contains a command that produces the text of the | |
28 | ?S: /etc/passwd file. This is normally "cat /etc/passwd", but can be | |
29 | ?S: "ypcat passwd" when NIS is used. | |
30 | ?S: On some systems, such as os390, there may be no equivalent | |
31 | ?S: command, in which case this variable is unset. | |
32 | ?S:. | |
33 | ?S:groupcat: | |
34 | ?S: This variable contains a command that produces the text of the | |
35 | ?S: /etc/group file. This is normally "cat /etc/group", but can be | |
36 | ?S: "ypcat group" when NIS is used. | |
37 | ?S: On some systems, such as os390, there may be no equivalent | |
38 | ?S: command, in which case this variable is unset. | |
39 | ?S:. | |
40 | ?S:hostcat: | |
41 | ?S: This variable contains a command that produces the text of the | |
42 | ?S: /etc/hosts file. This is normally "cat /etc/hosts", but can be | |
43 | ?S: "ypcat hosts" when NIS is used. | |
44 | ?S: On some systems, such as os390, there may be no equivalent | |
45 | ?S: command, in which case this variable is unset. | |
46 | ?S:. | |
47 | : see if we have to deal with yellow pages, now NIS. | |
48 | ?X: NeXT gives us some fun here, as always, by having both NIS (former YP) | |
49 | ?X: and NetInfo. But since it has both, it's ok to put the test inside the if. | |
50 | ?X: Contributed by Thomas Neumann <tom@smart.bo.open.de>. | |
19be151f | 51 | if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then |
edd6115f JH |
52 | if $test -f /usr/etc/nibindd; then |
53 | echo " " | |
54 | echo "I'm fairly confident you're on a NeXT." | |
55 | @if passcat || groupcat | |
56 | echo " " | |
57 | rp='Do you get the passwd file via NetInfo?' | |
58 | dflt=y | |
59 | case "$passcat" in | |
60 | nidump*) ;; | |
61 | '') ;; | |
62 | *) dflt=n;; | |
63 | esac | |
64 | . ./myread | |
65 | case "$ans" in | |
66 | y*) passcat='nidump passwd .' | |
67 | @if groupcat | |
68 | echo "(Assuming /etc/group is also distributed.)" | |
69 | groupcat='nidump group .' | |
70 | @end | |
71 | ;; | |
72 | *) echo "You told me, so don't blame me." | |
73 | case "$passcat" in | |
74 | nidump*) passcat='' | |
75 | @if groupcat | |
76 | groupcat='';; | |
77 | @end | |
78 | esac | |
79 | @if groupcat | |
80 | echo "(Assuming /etc/group is handled the same way.)" | |
81 | @end | |
82 | ;; | |
83 | esac | |
84 | @end | |
85 | @if hostcat | |
86 | echo " " | |
87 | rp='Do you get the hosts file via NetInfo?' | |
88 | dflt=y | |
89 | case "$hostcat" in | |
90 | nidump*) ;; | |
91 | '') ;; | |
92 | *) dflt=n;; | |
93 | esac | |
94 | . ./myread | |
95 | case "$ans" in | |
96 | y*) hostcat='nidump hosts .';; | |
97 | *) case "$hostcat" in | |
98 | nidump*) hostcat='';; | |
99 | esac | |
100 | ;; | |
101 | esac | |
102 | @end | |
103 | fi | |
104 | @if passcat || groupcat | |
105 | case "$passcat" in | |
106 | nidump*) ;; | |
107 | *) | |
108 | case "$passcat" in | |
109 | *ypcat*) dflt=y;; | |
110 | '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then | |
111 | dflt=y | |
112 | else | |
113 | dflt=n | |
114 | fi;; | |
115 | *) dflt=n;; | |
116 | esac | |
117 | echo " " | |
118 | rp='Are you getting the passwd file via yellow pages?' | |
119 | . ./myread | |
120 | case "$ans" in | |
121 | y*) passcat='ypcat passwd' | |
122 | @if groupcat | |
123 | echo "(Assuming /etc/group is also distributed.)" | |
124 | groupcat='ypcat group' | |
125 | @end | |
126 | ;; | |
127 | *) passcat='cat /etc/passwd' | |
128 | @if groupcat | |
129 | echo "(Assuming /etc/group is also local.)" | |
130 | groupcat='cat /etc/group' | |
131 | @end | |
132 | ;; | |
133 | esac | |
134 | ;; | |
135 | esac | |
136 | @end | |
137 | @if hostcat | |
138 | case "$hostcat" in | |
139 | nidump*) ;; | |
140 | *) | |
141 | case "$hostcat" in | |
142 | *ypcat*) dflt=y;; | |
143 | '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then | |
144 | dflt=y | |
145 | else | |
146 | dflt=n | |
147 | fi;; | |
148 | *) dflt=n;; | |
149 | esac | |
150 | echo " " | |
151 | rp='Are you getting the hosts file via yellow pages?' | |
152 | . ./myread | |
153 | case "$ans" in | |
154 | y*) hostcat='ypcat hosts';; | |
155 | *) hostcat='cat /etc/hosts';; | |
156 | esac | |
157 | ;; | |
158 | esac | |
159 | @end | |
160 | fi | |
161 | ?X: Ensure suitable default -- Manoj Srivastava | |
162 | case "$hostcat" in | |
163 | '') test -f /etc/hosts && hostcat='cat /etc/hosts';; | |
164 | esac | |
165 | case "$groupcat" in | |
166 | '') test -f /etc/group && groupcat='cat /etc/group';; | |
167 | esac | |
168 | case "$passcat" in | |
169 | '') test -f /etc/passwd && passcat='cat /etc/passwd';; | |
170 | esac | |
171 |