entrypoint.sh 621 B

12345678910111213141516171819202122232425
  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. printenv SSH_CLIENT_PUBLIC_KEYS > ~/.ssh/authorized_keys
  12. unset SSH_CLIENT_PUBLIC_KEYS
  13. if [ -z "$MYSQLDUMP_ARGS" ]; then
  14. echo -e 'missing environment variable MYSQLDUMP_ARGS\n' >&2
  15. set -x
  16. mysqldump --help
  17. exit 1
  18. fi
  19. unset MYSQLDUMP_ARGS
  20. exec "$@"