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:
committed by
William Hubbs
parent
1e5322e5c5
commit
a511a48d77
@@ -26,7 +26,7 @@ start()
|
|||||||
else
|
else
|
||||||
# HOSTNAME variable used to be defined in caps in conf.d/hostname.
|
# HOSTNAME variable used to be defined in caps in conf.d/hostname.
|
||||||
# It is also a magic variable in bash.
|
# It is also a magic variable in bash.
|
||||||
h=${hostname-${HOSTNAME}} # checkbashisms: false positive
|
h=${hostname:-${HOSTNAME}} # checkbashisms: false positive (HOSTNAME var)
|
||||||
fi
|
fi
|
||||||
if [ -z "$h" ]; then
|
if [ -z "$h" ]; then
|
||||||
einfo "Using default system hostname"
|
einfo "Using default system hostname"
|
||||||
|
|||||||
Reference in New Issue
Block a user