Bugfix wsdd args concat

Using brackets in string concatenation has special meaning
for for bash thus later argument never gets appended. Use
simple strings concat instead fixes problem.
This commit is contained in:
Edvinas 2020-05-20 23:54:14 +03:00 committed by GitHub
parent 67d033ad0c
commit 5846cd7ef0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,20 +1,20 @@
#!/usr/bin/env bash #!/usr/bin/env bash
args=( ) args=
if [ ! -z "${HOSTNAME}" ]; then if [ ! -z "${HOSTNAME}" ]; then
args+=( "-n $HOSTNAME ") args+="-n $HOSTNAME "
else else
echo "HOSTNAME environment variable must be set." echo "HOSTNAME environment variable must be set."
exit 1 exit 1
fi fi
if [ ! -z "${WORKGROUP}" ]; then if [ ! -z "${WORKGROUP}" ]; then
args+=( "-w $WORKGROUP " ) args+="-w $WORKGROUP "
fi fi
if [ ! -z "${DOMAIN}" ]; then if [ ! -z "${DOMAIN}" ]; then
args+=( "-d $DOMAIN " ) args+="-d $DOMAIN "
fi fi