aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuno Silva <nuno.m.ribeiro.silva@tecnico.ulisboa.pt>2017-06-10 03:12:49 +0100
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-06-12 10:44:27 -0500
commita511a48d77b1dcb8a3fb0dd1abddb750a152869b (patch)
tree00f0ea8cbc588e43578466a0e4fab66aad863204
parent1e5322e5c55ec744a2cdcc3342ef6547eab7c46f (diff)
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.
-rw-r--r--init.d/hostname.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/init.d/hostname.in b/init.d/hostname.in
index c144a710..d7913bed 100644
--- a/init.d/hostname.in
+++ b/init.d/hostname.in
@@ -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"