cloudfoundry-community/bosh-gen — pull request #23 by wdneto (2014-02-05 01:46:53+00:00)
Title: Minor fixes

Noticed that on the ctl_setup script, one of its use cases is to allow setup for various programs running within the same job.

Unfortunately the variable assignment at the top of the helper script appears to be incorrect.

Usages (as shown at the top of ctl_setup.sh script):
1)source /var/vcap/jobs/foobar/helpers/ctl_setup.sh foobar
2)source /var/vcap/jobs/foobar/helpers/ctl_setup.sh foobar nginx

With the current assignment:
```
JOB_NAME=$1
output_label=${1:-JOB_NAME}
```

In both usage cases, it results in the following values being assigned:
JOB_NAME=foobar
output_label=foobar

This is because output_label is looking at ${1......

Changing it to ${2... addresses the issue when $2 is set, however, if $2 isn't set, this would still return incorrectly:
JOB_NAME=foobar
output_label=JOB_NAME (literal string)

Modifying output_label to read '${2:-${JOB_NAME}}' addresses both issues - it sets output_label to the same value as $JOB_NAME ($1), if unset. Otherwise use the value of $2 provided.

This is what I think was the intention of that variable (correct me if I'm wrong).