File: gen_bootparam_sets

package info (click to toggle)
tiger 2.2.4-22
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,188 kB
  • ctags: 240
  • sloc: sh: 8,388; ansic: 2,109; makefile: 141; perl: 106
file content (52 lines) | stat: -rwxr-xr-x 1,265 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
#
#     tiger - A UN*X security checking system
#     Copyright (C) 1993 Douglas Lee Schales, David K. Hess, David R. Safford
#
#     Please see the file `COPYING' for the complete copyright notice.
#
# NeXT/3/gen_bootparam_sets - 06/14/93
#
#-----------------------------------------------------------------------------
#

COUNT=1

/usr/etc/nidomain -l | 
$AWK '{ print substr($1,5,length($1) - 4) }' |
{
  while read NETINFO_TAG
  do
    BOOTPARAM_SET=$WORKDIR/bootparam.set$COUNT.$$

    /usr/bin/nidump -t bootparams localhost/$NETINFO_TAG |
    $SED -e 's/#.*$//' |
    $SED -e '/^[ \t]*$/d' |
    $AWK '
	 BEGIN {LINE="";}
	 /\\\\$/ {LINE=LINE " " substr($0, 1, length($0)-1);}
	!/\\\\$/ {print LINE $0; LINE="";}
    ' > $BOOTPARAM_SET

    echo "NetInfo($NETINFO_TAG)" > $BOOTPARAM_SET.src
    echo $BOOTPARAM_SET
    COUNT=`$EXPR $COUNT + 1`
  done
}

[ -n "$YP" ] && {
  BOOTPARAM_SET=$WORKDIR/bootparam.set.nis.$$
  $YPCAT bootparams > $BOOTPARAM_SET
  echo "NIS" > $BOOTPARAM_SET.src
  echo $BOOTPARAM_SET
}

[ -r /etc/bootparams ] && {
  BOOTPARAM_SET=$WORKDIR/bootparam.set.etc.$$
  $CAT /etc/bootparams |
  $SED -e 's/#.*$//' |
  $SED -e '/^[ \t]*$/d' > $BOOTPARAM_SET

  echo "/etc/bootparams" > $BOOTPARAM_SET.src
  echo $BOOTPARAM_SET
}