From 3d62607f335e92fbf95dfc1a2036e761b7944f51 Mon Sep 17 00:00:00 2001 From: angelos <> Date: Mon, 9 Aug 1999 21:49:04 +0000 Subject: [PATCH] Only parse/setup the hostname.foo file if interface foo exists (this is useful for laptops with different ethernet cards etc.) --- src/etc/netstart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/etc/netstart b/src/etc/netstart index 1dff9264..78b1ac2d 100644 --- a/src/etc/netstart +++ b/src/etc/netstart @@ -1,6 +1,6 @@ #!/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 isalphanumeric() { @@ -92,6 +92,12 @@ for hn in /etc/hostname.*; do continue 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 { read af name mask bcaddr extras