mirror of
https://github.com/teest114514/chatlog_alpha.git
synced 2026-04-22 09:00:32 +08:00
21 lines
340 B
Bash
21 lines
340 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
[ -n "${UMASK:-}" ] && umask "$UMASK"
|
|
|
|
if [ "$(id -u)" = '0' ]; then
|
|
PUID=${PUID:-1000}
|
|
PGID=${PGID:-1000}
|
|
|
|
DATA_DIRS="/app /usr/local/bin"
|
|
for DIR in ${DATA_DIRS}; do
|
|
if [ -d "$DIR" ]; then
|
|
chown -R "${PUID}:${PGID}" "$DIR" || true
|
|
fi
|
|
done
|
|
|
|
exec gosu "${PUID}:${PGID}" "$@"
|
|
else
|
|
exec "$@"
|
|
fi
|