summaryrefslogtreecommitdiffstats
path: root/hooks
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-03-31 19:45:17 +0100
committerRoy Marples <roy@marples.name>2020-03-31 19:45:17 +0100
commitbbf2c290fbf303b684eb1366cfb61d0a48e8e40c (patch)
tree60b7b3aa33562bce9317d294b3964d83dcaca802 /hooks
parent645d14292178c4f6a6f7d359ff8eeb87998f7a35 (diff)
downloaddhcpcd-bbf2c290fbf303b684eb1366cfb61d0a48e8e40c.tar.xz
linux: the default hostname is (none)
It's blank for the BSD's. Respect this when relinquishing the hostname.
Diffstat (limited to 'hooks')
-rw-r--r--hooks/30-hostname.in (renamed from hooks/30-hostname)4
-rw-r--r--hooks/Makefile1
2 files changed, 3 insertions, 2 deletions
diff --git a/hooks/30-hostname b/hooks/30-hostname.in
index 3ac73ea4..579c73d3 100644
--- a/hooks/30-hostname
+++ b/hooks/30-hostname.in
@@ -17,7 +17,7 @@
# If we used to set the hostname, but relinquish control of it, we should
# reset to the default value.
-: ${hostname_default=}
+: ${hostname_default=@DEFAULT_HOSTNAME@}
# Some systems don't have hostname(1)
_hostname()
@@ -54,7 +54,7 @@ _hostname()
is_default_hostname()
{
case "$1" in
- ""|"(none)"|localhost|localhost.localdomain|"$hostname_default")
+ ""|"$hostname_default"|localhost|localhost.localdomain)
return 0;;
esac
return 1
diff --git a/hooks/Makefile b/hooks/Makefile
index c1332e58..aa908c12 100644
--- a/hooks/Makefile
+++ b/hooks/Makefile
@@ -27,6 +27,7 @@ FILES+= ${EGHOOKSCRIPTS}
${SED_SYS} ${SED_SCRIPT} ${SED_DATADIR} \
${SED_SERVICEEXISTS} ${SED_SERVICECMD} ${SED_SERVICESTATUS} \
${SED_STATUSARG} \
+ ${SED_DEFAULT_HOSTNAME} \
-e 's:@YPDOMAIN_DIR@:${YPDOMAIN_DIR}:g' \
-e 's:@YPDOMAIN_SUFFIX@:${YPDOMAIN_SUFFIX}:g' \
$< > $@