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.

34 lines
903 B

  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. *)
  27. exec /usr/bin/weed $@
  28. ;;
  29. esac