feat: Send commands to weed shell from the docker image.

Add the ability to send commands to weed shell from the docker image.

Allows an operator to perform maintenance commands like so:
```
docker run \
  --rm \
  -e SHELL_FILER=localhost:8888 \
  -e SHELL_MASTER=localhost:9333 \
  chrislusf/seaweedfs:local \
  "shell" \
  "fs.configure -locationPrefix=/buckets/foo -volumeGrowthCount=3 -replication=002 -apply"
```
This commit is contained in:
Kaiwalya Joshi 2022-06-01 15:47:10 -07:00
parent e152dc8fae
commit 47d335cf8c
No known key found for this signature in database
GPG Key ID: 099DF5226286CD44

View File

@ -57,6 +57,12 @@ case "$1" in
exec /usr/bin/weed -logtostderr=true s3 $ARGS $@
;;
'shell')
ARGS="-cluster=$SHELL_CLUSTER -filer=$SHELL_FILER -filerGroup=$SHELL_FILER_GROUP -master=$SHELL_MASTER -options=$SHELL_OPTIONS"
shift
exec echo "$@" | /usr/bin/weed -logtostderr=true shell $ARGS
;;
*)
exec /usr/bin/weed $@
;;