You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

  1. #!/bin/sh
  2. case "$1" in
  3. 'master')
  4. ARGS="-ip `hostname -i` -mdir /data"
  5. # Is this instance linked with an other master? (Docker commandline "--link master1:master")
  6. if [ -n "$MASTER_PORT_9333_TCP_ADDR" ] ; then
  7. ARGS="$ARGS -peers=$MASTER_PORT_9333_TCP_ADDR:$MASTER_PORT_9333_TCP_PORT"
  8. fi
  9. exec /usr/bin/weed $@ $ARGS
  10. ;;
  11. 'volume')
  12. ARGS="-ip `hostname -i` -dir /data"
  13. # Is this instance linked with a master? (Docker commandline "--link master1:master")
  14. if [ -n "$MASTER_PORT_9333_TCP_ADDR" ] ; then
  15. ARGS="$ARGS -mserver=$MASTER_PORT_9333_TCP_ADDR:$MASTER_PORT_9333_TCP_PORT"
  16. fi
  17. exec /usr/bin/weed $@ $ARGS
  18. ;;
  19. 'server')
  20. ARGS="-ip `hostname -i` -dir /data"
  21. if [ -n "$MASTER_PORT_9333_TCP_ADDR" ] ; then
  22. ARGS="$ARGS -master.peers=$MASTER_PORT_9333_TCP_ADDR:$MASTER_PORT_9333_TCP_PORT"
  23. fi
  24. exec /usr/bin/weed $@ $ARGS
  25. ;;
  26. 'filer')
  27. ARGS="-ip `hostname -i` "
  28. if [ -n "$MASTER_PORT_9333_TCP_ADDR" ] ; then
  29. ARGS="$ARGS -master=$MASTER_PORT_9333_TCP_ADDR:$MASTER_PORT_9333_TCP_PORT"
  30. fi
  31. mkdir -p /data/filerdb
  32. exec /usr/bin/weed $@ $ARGS
  33. ;;
  34. 's3')
  35. ARGS="-domainName=$S3_DOMAIN_NAME -key.file=$S3_KEY_FILE -cert.file=$S3_CERT_FILE"
  36. if [ -n "$FILER_PORT_8888_TCP_ADDR" ] ; then
  37. ARGS="$ARGS -filer=$FILER_PORT_8888_TCP_ADDR:$FILER_PORT_8888_TCP_PORT"
  38. fi
  39. exec /usr/bin/weed $@ $ARGS
  40. ;;
  41. *)
  42. exec /usr/bin/weed $@
  43. ;;
  44. esac