entrypoint.sh 613 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. set -eu
  3. # sync with https://github.com/fphammerle/docker-gitolite/blob/master/entrypoint.sh
  4. if [ ! -f "$SSHD_HOST_KEYS_DIR/rsa" ]; then
  5. ssh-keygen -t rsa -b 4096 -N '' -f "$SSHD_HOST_KEYS_DIR/rsa"
  6. fi
  7. if [ ! -f "$SSHD_HOST_KEYS_DIR/ed25519" ]; then
  8. ssh-keygen -t ed25519 -N '' -f "$SSHD_HOST_KEYS_DIR/ed25519"
  9. fi
  10. unset SSHD_HOST_KEYS_DIR
  11. if [ -z "$MYSQLDUMP_ARGS" ]; then
  12. echo -e 'missing environment variable MYSQLDUMP_ARGS\n' >&2
  13. set -x
  14. mysqldump --help
  15. exit 1
  16. fi
  17. echo -e "#!/bin/sh\nexec mysqldump $MYSQLDUMP_ARGS" > /tmp/mysqldump.sh
  18. chmod u+x /tmp/mysqldump.sh
  19. exec "$@"