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:
parent
1e5322e5c5
commit
a511a48d77
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user