summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2003-08-27 11:49:36 +0000
committerhenning <henning@openbsd.org>2003-08-27 11:49:36 +0000
commit37bbdc83aa45951da098a00cf1beb5e197f31992 (patch)
treeddc78ee7e6ca3b814b0e3ac5e7b526b33af3fb5c
parent- sort SYNOPSIS and DESCRIPTION (diff)
downloadwireguard-openbsd-37bbdc83aa45951da098a00cf1beb5e197f31992.tar.xz
wireguard-openbsd-37bbdc83aa45951da098a00cf1beb5e197f31992.zip
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@
-rw-r--r--etc/netstart11
1 files changed, 8 insertions, 3 deletions
diff --git a/etc/netstart b/etc/netstart
index 6ccb0f28337..0cafe34fba0 100644
--- a/etc/netstart
+++ b/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