Files
docker-baseimage-alpine/root/etc/s6-overlay/s6-rc.d/init-adduser/run
info@pi-farm.de 9f61a307cc
All checks were successful
/ release-and-build (push) Successful in 1m29s
fixed username to pi
2026-02-18 01:08:40 +00:00

50 lines
1.5 KiB
Plaintext
Executable File

#!/usr/bin/with-contenv bash
# shellcheck shell=bash
PUID=${PUID:-911}
PGID=${PGID:-911}
if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then
USERHOME=$(grep pi /etc/passwd | cut -d ":" -f6)
usermod -d "/root" pi
groupmod -o -g "${PGID}" pi
usermod -o -u "${PUID}" pi
usermod -d "${USERHOME}" pi
fi
if { [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; } || [[ ! ${LSIO_FIRST_PARTY} = "true" ]]; then
cat /etc/s6-overlay/s6-rc.d/init-adduser/branding
else
cat /run/branding
fi
echo '
───────────────────────────────────────
GID/UID
───────────────────────────────────────'
if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
echo "
User UID: $(id -u pi)
User GID: $(id -g pi)
───────────────────────────────────────"
else
echo "
User UID: $(stat /run -c %u)
User GID: $(stat /run -c %g)
───────────────────────────────────────"
fi
if [[ -f /build_version ]]; then
cat /build_version
echo '
───────────────────────────────────────
'
fi
if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then
lsiown pi:pi /app
lsiown pi:pi /config
lsiown pi:pi /defaults
fi