]>
Commit | Line | Data |
---|---|---|
399d20ea FP |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
fd5e57bb | 4 | |
8d8a037e | 5 | find /config ! -user peertube -exec chown peertube:peertube {} \; || true |
b44a9630 | 6 | |
399d20ea FP |
7 | # first arg is `-f` or `--some-option` |
8 | # or first arg is `something.conf` | |
9 | if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then | |
4aeb67a5 | 10 | set -- npm "$@" |
399d20ea FP |
11 | fi |
12 | ||
13 | # allow the container to be started with `--user` | |
33837e8b | 14 | if [ "$1" = 'npm' -a "$(id -u)" = '0' ]; then |
e902e03f | 15 | find /data ! -user peertube -exec chown peertube:peertube {} \; |
4aeb67a5 | 16 | exec gosu peertube "$0" "$@" |
399d20ea FP |
17 | fi |
18 | ||
19 | exec "$@" |