aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.d/hostname.in6
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"