blob: 2e875a4b8457606f81f8f8757e381502d13814fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/sh
set -e
# Check for incomming Nginx server commands or subcommands only
if [ "$1" = "nginx" ] || [ "${1#-}" != "$1" ]; then
if [ "${1#-}" != "$1" ]; then
set -- nginx "$@"
fi
chown nginx:nginx /var/cache/cgit
chmod u+g /var/cache/cgit
# Replace environment variables only if `USE_CUSTOM_CONFIG` is not defined or equal to `false`
if [[ -z "$USE_CUSTOM_CONFIG" ]] || [[ "$USE_CUSTOM_CONFIG" = "false" ]]; then
envsubst < /tmp/cgitrc.tmpl > /etc/cgitrc
fi
spawn-fcgi \
-u nginx -g nginx \
-s /var/run/fcgiwrap.sock \
-n -- /usr/bin/fcgiwrap \
& exec "$@"
else
exec "$@"
fi
|