summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrpe <rpe@openbsd.org>2017-07-21 20:35:59 +0000
committerrpe <rpe@openbsd.org>2017-07-21 20:35:59 +0000
commitfc8b88eee48c004d66205833c8001062e327469a (patch)
tree28c4b9b4b48cc89f667e496a01f39e79eeaaab0e
parentAlign ifstart() in netstart and install.sub. (diff)
downloadwireguard-openbsd-fc8b88eee48c004d66205833c8001062e327469a.tar.xz
wireguard-openbsd-fc8b88eee48c004d66205833c8001062e327469a.zip
Rename _hn to AI_HOSTNAME and export it as global variable so it's
visible in the MODE.site scripts too. This is useful for reporting back the autoinstall status at the end of installs or upgrades from within the MODE.site scripts. OK krw@ tb@
-rw-r--r--distrib/miniroot/install.sub12
1 files changed, 6 insertions, 6 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index bb701d7c31c..1592339999a 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sub,v 1.1028 2017/07/21 20:22:13 rpe Exp $
+# $OpenBSD: install.sub,v 1.1029 2017/07/21 20:35:59 rpe Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -567,8 +567,8 @@ log_answers() {
# Fetch response file for autoinstall.
get_responsefile() {
- local _rf _if _lf _hn _path _aifile
- export AI_MAC= AI_MODE= AI_SERVER=
+ local _rf _if _lf _path _aifile
+ export AI_HOSTNAME= AI_MAC= AI_MODE= AI_SERVER=
[[ -f /auto_upgrade.conf ]] && _rf=/auto_upgrade.conf AI_MODE=upgrade
[[ -f /auto_install.conf ]] && _rf=/auto_install.conf AI_MODE=install
@@ -606,8 +606,8 @@ get_responsefile() {
server-name tftp-server-name next-server)
# Prime hostname with host-name option from lease file.
- _hn=$(lease_value $_lf host-name)
- hostname "$_hn"
+ AI_HOSTNAME=$(lease_value $_lf host-name)
+ hostname "$AI_HOSTNAME"
done
# Fetch response file if server and mode are known, otherwise tell which
@@ -615,7 +615,7 @@ get_responsefile() {
# and finally mode.conf.
if [[ -n $AI_SERVER && -n $AI_MODE ]]; then
AI_MAC=$(ifconfig $_if | sed 's/.*lladdr \(.*\)/\1/p;d')
- for _rf in {$AI_MAC-,${_hn:+$_hn-,}}$AI_MODE; do
+ for _rf in {$AI_MAC-,${AI_HOSTNAME:+$AI_HOSTNAME-,}}$AI_MODE; do
_url="http://$AI_SERVER/$_path$_rf.conf?path=$HTTP_SETDIR"
echo "Fetching $_url"
if unpriv ftp -Vo - "$_url" \