Browse Source

install sample commented /etc/ifaliases file; which can now contain #

comments and blank lines. new format is "interface address netmask"
(yes, i changed the order of the entries). inspired by netbsd pr#2474;
gillhaa@ghost.whirlpool.com
OPENBSD_2_0
deraadt 28 years ago
parent
commit
1f41a0bf21
3 changed files with 18 additions and 11 deletions
  1. +5
    -4
      src/etc/Makefile
  2. +5
    -0
      src/etc/ifaliases
  3. +8
    -7
      src/etc/netstart

+ 5
- 4
src/etc/Makefile View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.14 1996/06/03 07:20:41 mickey Exp $
# $OpenBSD: Makefile,v 1.15 1996/06/16 12:57:30 deraadt Exp $
TZDIR= /usr/share/zoneinfo
LOCALTIME= US/Pacific
@ -15,9 +15,10 @@ BINOWN= root
BINGRP= wheel
BIN1= aliases bootptab changelist csh.cshrc csh.login csh.logout daily \
dm.conf ftpusers ftpchroot gettytab group hosts hosts.equiv hosts.lpd \
inetd.conf man.conf monthly motd myname netstart newsyslog.conf \
phones printcap protocols rc rc.local remote rpc security services \
shells syslog.conf weekly etc.${MACHINE}/ttys etc.${MACHINE}/disktab
ifaliases inetd.conf man.conf monthly motd myname netstart \
newsyslog.conf phones printcap protocols rc rc.local remote rpc \
security services shells syslog.conf weekly etc.${MACHINE}/ttys \
etc.${MACHINE}/disktab
# -rw-rw-r--
BIN2= motd


+ 5
- 0
src/etc/ifaliases View File

@ -0,0 +1,5 @@
# $OpenBSD: ifaliases,v 1.1 1996/06/16 12:57:30 deraadt Exp $
# This file contains a list of IP addresses aliases in the form
# interface address netmask
# ie:
# ep0 124.125.126.129 255.255.255.0

+ 8
- 7
src/etc/netstart View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $OpenBSD: netstart,v 1.6 1996/06/02 21:17:58 tholo Exp $
# $OpenBSD: netstart,v 1.7 1996/06/16 12:57:31 deraadt Exp $
# set these to "NO" to turn them off. otherwise, they're used as flags
routed_flags=-q
@ -120,15 +120,16 @@ fi
# /etc/ifaliases, if it exists, contains the names of additional IP
# addresses for each interface. It is formatted as a series of lines
# that contain
# address interface
# interface address netmask
if [ -f /etc/ifaliases ]; then
(
set -- `cat /etc/ifaliases`
# delete comments and blank lines
set -- `sed -e 's/#.*$//' /etc/ifaliases | grep -v '^$'`
while [ $# -ge 2 ] ; do
ifconfig $2 inet alias $1
route add $1 localhost
shift 2
while [ $# -ge 3 ] ; do
ifconfig $1 inet alias $2 netmask $3
route add $2 localhost
shift 3
done
)
fi

Loading…
Cancel
Save