Introduce WSDD_ARGS to directly pass wsdd arguments.

This commit is contained in:
shimikano 2020-02-19 17:22:24 +01:00
parent 67d033ad0c
commit 4ace370a40
2 changed files with 22 additions and 19 deletions

View file

@ -4,11 +4,13 @@ Docker image for wsdd.py.
wsdd implements a Web Service Discovery host daemon. This enables (Samba) hosts, like your local NAS device or Linux server, to be found by Web Service Discovery Clients like Windows. wsdd implements a Web Service Discovery host daemon. This enables (Samba) hosts, like your local NAS device or Linux server, to be found by Web Service Discovery Clients like Windows.
## Supported environment variables ## Supported environment variables
HOSTNAME: Samba Netbios name to report. `HOSTNAME`: Samba Netbios name to report.
WORKGROUP: Workgroup name `WORKGROUP`: Workgroup name
DOMAIN: Report being a member of an AD DOMAIN. Disables WORKGROUP if set. `DOMAIN`: Report being a member of an AD DOMAIN. Disables `WORKGROUP` if set.
Alternatively, you can pass all desired wsdd arguments in the environment variable `WSDD_ARGS`. In this case, the arguments are passed as-is and all other environment variables are ignored.
## Running container ## Running container
### From command line ### From command line

View file

@ -2,22 +2,23 @@
args=( ) args=( )
if [ ! -z "${HOSTNAME}" ]; then if [ ! -z "${WSDD_ARGS}" ]; then
args+=( "-n $HOSTNAME ") args=${WSDD_ARGS}
else else
echo "HOSTNAME environment variable must be set." if [ ! -z "${HOSTNAME}" ]; then
exit 1 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
fi fi
if [ ! -z "${WORKGROUP}" ]; then
args+=( "-w $WORKGROUP " )
fi
if [ ! -z "${DOMAIN}" ]; then
args+=( "-d $DOMAIN " )
fi
exec python wsdd.py ${args} exec python wsdd.py ${args}