[BACK]Return to netstart CVS log [TXT][DIR] Up to [local] / src / etc

Diff for /src/etc/netstart between version 1.46 and 1.47

version 1.46, 1999/03/01 05:04:24 version 1.47, 1999/03/26 14:34:31
Line 54 
Line 54 
 #  #
 # OR  # OR
 #  #
 # dhcp  # dhcp
 #  #
   # OR
   #
   # bridge
   # brconfig-arguments [ several lines if needed ]
   #
 # addr_family is the address family of the interface, generally inet  # addr_family is the address family of the interface, generally inet
 # hostname is the host name that belongs to the interface, in /etc/hosts.  # hostname is the host name that belongs to the interface, in /etc/hosts.
 # netmask is the network mask for the interface.  # netmask is the network mask for the interface.
Line 66 
Line 71 
 # has a "destination" (i.e. it's a point-to-point link, like SLIP).  # has a "destination" (i.e. it's a point-to-point link, like SLIP).
 # dest_addr is the hostname of the other end of the link, in /etc/hosts  # dest_addr is the hostname of the other end of the link, in /etc/hosts
 #  #
   # the only required contents of the file in this mode are the addr_family field
   # and the hostname.
   #
 # dhcp is simply the string "dhcp" (no quotes, though) if the interface  # dhcp is simply the string "dhcp" (no quotes, though) if the interface
 # is to be configured using DHCP.  See dhclient(8) and dhclient.conf(5)  # is to be configured using DHCP.  See dhclient(8) and dhclient.conf(5)
 # for details.  # for details.
 #  #
 # the only required contents of the file are the addr_family field  # bridge is the string "bridge" (still no quotes).  Bridge interfaces
 # and the hostname.  # are just configured "up" and then brconfig(8) is called for each
   # line of arguments following this first line.
   
 (  for hn in /etc/hostname.*; do
     for hn in /etc/hostname.*; do      # Strip off /etc/hostname. prefix
         # Strip off /etc/hostname. prefix      if=${hn#/etc/hostname.}
         if=${hn#/etc/hostname.}  
   
         # Interface names must be alphanumeric only.  We check to avoid      # Interface names must be alphanumeric only.  We check to avoid
         # configuring backup or temp files, and to catch the "*" case.      # configuring backup or temp files, and to catch the "*" case.
         if ! isalphanumeric "$if"; then      if ! isalphanumeric "$if"; then
             continue          continue
         fi      fi
   
         # Now parse the hostname.* file      # Now parse the hostname.* file
         (      {
             read af name mask bcaddr extras          read af name mask bcaddr extras
   
           # $af can be either "bridge", "dhcp", "up" or an address family.
           case "$af" in
           "bridge")
               ifconfig $if up
               cmd=`sed "s/\(.*\)/brconfig $if \1;/"`
               ;;
           "dhcp")
               ifconfig $if $extras down
               cmd="/sbin/dhclient $if"
               ;;
           "up")
               # The only one of these guaranteed to be set is $if
               cmd="ifconfig $if $name $mask $bcaddr $extras up"
               ;;
           *)
             read dt dtaddr              read dt dtaddr
               if [ ! -n "$name" ]; then
                   echo "/etc/hostname.$if: invalid network configuration file"
                   exit
               fi
   
             # $af can be either "up", "dhcp", or an address family.              cmd="ifconfig $if $af $name "
             if [ "$af" = "up" ]; then              if [ "${dt}" = "dest" ]; then cmd="$cmd $dtaddr"; fi
                 # The only one of these guaranteed to be set is $if              if [ -n "$mask" ]; then cmd="$cmd netmask $mask"; fi
                 ifconfig $if $name $mask $bcaddr $extras up              if [ -n "$bcaddr" -a "X$bcaddr" != "XNONE" ]; then
             elif [ "$af" = "dhcp" ]; then                  cmd="$cmd broadcast $bcaddr";
                 ifconfig $if $extras down  
                 cmd="/sbin/dhclient $if";  
             else  
                 if [ ! -n "$name" ]; then  
                     echo "/etc/hostname.$if: invalid network configuration file"  
                     exit  
                 fi  
   
                 cmd="ifconfig $if $af $name "  
                 if [ "${dt}" = "dest" ]; then cmd="$cmd $dtaddr"; fi  
                 if [ -n "$mask" ]; then cmd="$cmd netmask $mask"; fi  
                 if [ -n "$bcaddr" -a "X$bcaddr" != "XNONE" ]; then  
                     cmd="$cmd broadcast $bcaddr";  
                 fi  
                 cmd="$cmd $extras";  
             fi              fi
               cmd="$cmd $extras";
               ;;
           esac
   
             $cmd          eval "$cmd"
         ) < /etc/hostname.$if      } < /etc/hostname.$if
     done  done
 )  
   
 # /etc/mygate, if it exists, contains the name of my gateway host  # /etc/mygate, if it exists, contains the name of my gateway host
 # that name must be in /etc/hosts.  # that name must be in /etc/hosts.

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47