init.d/hostname: fix default parameter syntax

The syntax for expanding a variable with a default value is
	${parameter:-word}
not
	${parameter-word}
although the latter still works for a reason I could not explain.

This fixes #143.
This commit is contained in:
Nuno Silva 2017-06-10 03:12:49 +01:00 committed by William Hubbs
parent 1e5322e5c5
commit a511a48d77

View File

@ -26,7 +26,7 @@ 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}} # checkbashisms: false positive
h=${hostname:-${HOSTNAME}} # checkbashisms: false positive (HOSTNAME var)
fi
if [ -z "$h" ]; then
einfo "Using default system hostname"