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