2023-03-12 07:13:53 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-08-12 06:56:54 +03:00
|
|
|
set -e
|
|
|
|
|
2023-08-06 04:11:29 +03:00
|
|
|
if [ "$(id -u)" -eq 0 ]; then
|
|
|
|
[ -n "${PUID}" ] && usermod -u "${PUID}" nobody
|
|
|
|
[ -n "${PGID}" ] && groupmod -g "${PGID}" nobody
|
|
|
|
fi
|
2023-03-12 07:13:53 +03:00
|
|
|
|
2023-08-12 06:56:54 +03:00
|
|
|
printf "Configuring application...\n"
|
2023-03-12 07:13:53 +03:00
|
|
|
|
2023-08-06 04:11:29 +03:00
|
|
|
if [ "$(id -u)" -eq 0 ]; then
|
|
|
|
printf "Switching UID=%s and GID=%s\n" "$(id -u nobody)" "$(id -g nobody)"
|
|
|
|
exec su-exec nobody:nobody "$@"
|
|
|
|
else
|
2023-08-06 05:03:56 +03:00
|
|
|
exec "$@"
|
2023-08-06 04:11:29 +03:00
|
|
|
fi
|