summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-11-29 20:14:06 +0000
committerderaadt <deraadt@openbsd.org>2020-11-29 20:14:06 +0000
commit4f9a4669cf63e035252969a85fcd7af33c08a80c (patch)
tree27ef6192372f6e0012e960eb13e3305a3dd0b016 /etc/rc
parentSync bsnprintf() with ldapd/util.c r1.13 (diff)
downloadwireguard-openbsd-4f9a4669cf63e035252969a85fcd7af33c08a80c.tar.xz
wireguard-openbsd-4f9a4669cf63e035252969a85fcd7af33c08a80c.zip
Add support for !command to mygate, so that netstart has a late opportunity
to perform network configuration (for example, "!route source -ifp em0") Split mygate and myname manual pages (how did anyone ever believe these are related), and perform hostname configuration much earlier in rc. discussed with benno, claudio, jmc, etc etc, last version of !command parser by tb
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc7
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/rc b/etc/rc
index 44d67f34bf5..94465add54f 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.543 2020/01/24 06:17:37 tedu Exp $
+# $OpenBSD: rc,v 1.544 2020/11/29 20:14:06 deraadt Exp $
# System startup script run by init on autoboot or after single-user.
# Output and error are redirected to console by init, and the console is the
@@ -301,6 +301,11 @@ export HOME=/
export INRC=1
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
+# /etc/myname contains my symbolic name.
+if [[ -f /etc/myname ]]; then
+ hostname "$(stripcom /etc/myname)"
+fi
+
# Must set the domainname before rc.conf, so YP startup choices can be made.
if [[ -s /etc/defaultdomain ]]; then
domainname "$(stripcom /etc/defaultdomain)"