
Using brackets in string concatenation has special meaning for for bash thus later argument never gets appended. Use simple strings concat instead fixes problem.
23 lines
301 B
Bash
Executable file
23 lines
301 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
args=
|
|
|
|
if [ ! -z "${HOSTNAME}" ]; then
|
|
args+="-n $HOSTNAME "
|
|
else
|
|
echo "HOSTNAME environment variable must be set."
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -z "${WORKGROUP}" ]; then
|
|
args+="-w $WORKGROUP "
|
|
fi
|
|
|
|
if [ ! -z "${DOMAIN}" ]; then
|
|
args+="-d $DOMAIN "
|
|
fi
|
|
|
|
|
|
|
|
exec python wsdd.py ${args}
|
|
|