Browse Source

Only parse/setup the hostname.foo file if interface foo exists (this

is useful for laptops with different ethernet cards etc.)
OPENBSD_2_6
angelos 25 years ago
parent
commit
3d62607f33
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      src/etc/netstart

+ 7
- 1
src/etc/netstart View File

@ -1,6 +1,6 @@
#!/bin/sh - #!/bin/sh -
# #
# $OpenBSD: netstart,v 1.48 1999/03/29 22:09:58 niklas Exp $
# $OpenBSD: netstart,v 1.49 1999/08/09 21:49:04 angelos Exp $
# Returns true if $1 contains only alphanumerics # Returns true if $1 contains only alphanumerics
isalphanumeric() { isalphanumeric() {
@ -92,6 +92,12 @@ for hn in /etc/hostname.*; do
continue continue
fi fi
# If the interface does not exist, just skip processing the file
/sbin/ifconfig $if > /dev/null 2>&1
if [ "$?" != "0" ]; then
continue
fi
# Now parse the hostname.* file # Now parse the hostname.* file
{ {
read af name mask bcaddr extras read af name mask bcaddr extras


Loading…
Cancel
Save