2023-03-20 06:56:52 +00:00
|
|
|
#!/command/with-contenv bash
|
|
|
|
# shellcheck shell=bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
PUID=${PUID:-911}
|
|
|
|
PGID=${PGID:-911}
|
|
|
|
|
2023-03-23 00:21:34 +00:00
|
|
|
log_info 'Configuring npmuser ...'
|
2023-03-20 06:56:52 +00:00
|
|
|
|
|
|
|
groupmod -g 1000 users || exit 1
|
2023-03-23 00:21:34 +00:00
|
|
|
|
|
|
|
if id -u npmuser; then
|
|
|
|
# user already exists
|
|
|
|
usermod -u "${PUID}" npmuser || exit 1
|
|
|
|
else
|
|
|
|
# Add npmuser user
|
|
|
|
useradd -u "${PUID}" -U -d /tmp/npmuserhome -s /bin/false npmuser || exit 1
|
|
|
|
fi
|
|
|
|
|
2023-03-20 06:56:52 +00:00
|
|
|
usermod -G users npmuser || exit 1
|
2023-03-23 00:21:34 +00:00
|
|
|
groupmod -o -g "${PGID}" npmuser || exit 1
|
2023-03-20 06:56:52 +00:00
|
|
|
# Home for npmuser
|
|
|
|
mkdir -p /tmp/npmuserhome
|
|
|
|
chown -R npmuser:npmuser /tmp/npmuserhome
|