diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2016-08-24 13:43:11 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2016-08-24 13:43:11 -0500 |
commit | 4018dfc8de4818101c336ff8bcf0f4762b318c6a (patch) | |
tree | bb579bd28f0a32bd4041e15899d7281194ebef62 /init.d | |
parent | 353bb9bc9a0ab3c6650d72d2ceb14c990762a2a0 (diff) |
init.d/hostname: do not use localhost as a default hostname
This allows the operating system default hostname to be used if no
hostname is configured.
Diffstat (limited to 'init.d')
-rw-r--r-- | init.d/hostname.in | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/init.d/hostname.in b/init.d/hostname.in index 74866b4c..253d338d 100644 --- a/init.d/hostname.in +++ b/init.d/hostname.in @@ -24,7 +24,11 @@ start() else # HOSTNAME variable used to be defined in caps in conf.d/hostname. # It is also a magic variable in bash. - h=${hostname-${HOSTNAME-localhost}} # checkbashisms: false positive + h=${hostname-${HOSTNAME}} # checkbashisms: false positive + fi + if [ -z "$h" ]; then + einfo "Using default system hostname" + return 0 fi ebegin "Setting hostname to $h $source" hostname "$h" |