entrypoint.sh 464 B

12345678910111213141516171819
  1. #!/bin/sh
  2. set -e
  3. find /config ! -user peertube -exec chown peertube:peertube {} \; || true
  4. # first arg is `-f` or `--some-option`
  5. # or first arg is `something.conf`
  6. if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then
  7. set -- node "$@"
  8. fi
  9. # allow the container to be started with `--user`
  10. if [ "$1" = 'node' -a "$(id -u)" = '0' ]; then
  11. find /data ! -user peertube -exec chown peertube:peertube {} \;
  12. exec gosu peertube "$0" "$@"
  13. fi
  14. exec "$@"