diff options
| author | hilimd <68371223+hilimd@users.noreply.github.com> | 2020-10-10 13:07:57 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-10 13:07:57 +0800 |
| commit | 411e49f96494629fa3da334e8dc7cc15bd4d19cd (patch) | |
| tree | 1756f0a2f86c871a6db67df7ecbd509c9df32233 /docker/entrypoint.sh | |
| parent | ac162fc85769cb1b2a1f8694f9644eae7d0ce6c8 (diff) | |
| parent | 4a15e9c830de1b654515308e5be8380ffa34aefa (diff) | |
| download | seaweedfs-411e49f96494629fa3da334e8dc7cc15bd4d19cd.tar.xz seaweedfs-411e49f96494629fa3da334e8dc7cc15bd4d19cd.zip | |
Merge pull request #23 from chrislusf/master
sync
Diffstat (limited to 'docker/entrypoint.sh')
| -rwxr-xr-x | docker/entrypoint.sh | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 05db7a672..427576bcf 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,5 +1,24 @@ #!/bin/sh +isArgPassed() { + arg="$1" + argWithEqualSign="$1=" + shift + while [ $# -gt 0 ]; do + passedArg="$1" + shift + case $passedArg in + $arg) + return 0 + ;; + $argWithEqualSign*) + return 0 + ;; + esac + done + return 1 +} + case "$1" in 'master') @@ -9,7 +28,7 @@ case "$1" in 'volume') ARGS="-dir=/data -max=0" - if [[ $@ == *"-max="* ]]; then + if isArgPassed "-max" "$@"; then ARGS="-dir=/data" fi exec /usr/bin/weed $@ $ARGS @@ -17,7 +36,7 @@ case "$1" in 'server') ARGS="-dir=/data -volume.max=0 -master.volumePreallocate -master.volumeSizeLimitMB=1024" - if [[ $@ == *"-volume.max="* ]]; then + if isArgPassed "-volume.max" "$@"; then ARGS="-dir=/data -master.volumePreallocate -master.volumeSizeLimitMB=1024" fi exec /usr/bin/weed $@ $ARGS |
