mirror of
https://git.mills.io/prologic/zs.git
synced 2024-09-07 20:54:20 -04:00
18 lines
364 B
Bash
Executable File
18 lines
364 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if [ "$(id -u)" -eq 0 ]; then
|
|
[ -n "${PUID}" ] && usermod -u "${PUID}" nobody
|
|
[ -n "${PGID}" ] && groupmod -g "${PGID}" nobody
|
|
fi
|
|
|
|
printf "Configuring application...\n"
|
|
|
|
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
|
|
exec "$@"
|
|
fi
|