From eb7282af994fa28f00e89c096f544c7296a21217 Mon Sep 17 00:00:00 2001 From: henning <> Date: Wed, 27 Aug 2003 11:49:36 +0000 Subject: [PATCH] only try to set hostname to what /etc/myname says if that file actually exists, otherwise preserve `hostname` netbooted machines can live perfectly fine without it; they get their hostname earlier. ok krw@ cedric@ --- src/etc/netstart | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/etc/netstart b/src/etc/netstart index 6ccb0f28..0cafe34f 100644 --- a/src/etc/netstart +++ b/src/etc/netstart @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: netstart,v 1.86 2003/02/16 23:25:40 krw Exp $ +# $OpenBSD: netstart,v 1.87 2003/08/27 11:49:36 henning Exp $ # Returns true if $1 contains only alphanumerics isalphanumeric() { @@ -175,8 +175,13 @@ fi # Otherwise, process with the complete network initialization. # /etc/myname contains my symbolic name -hostname=`cat /etc/myname` -hostname $hostname +if [ -f /etc/myname ]; then + hostname=`cat /etc/myname` + hostname $hostname +else + hostname=`hostname` +fi + if [ -f /etc/defaultdomain ]; then domainname `cat /etc/defaultdomain` fi