mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-02-03 02:08:12 -05:00
21 lines
452 B
Bash
Executable File
21 lines
452 B
Bash
Executable File
#!/command/with-contenv bash
|
|
# shellcheck shell=bash
|
|
|
|
set -e
|
|
|
|
log_info "Configuring $NPMUSER user ..."
|
|
|
|
if id -u "$NPMUSER"; then
|
|
# user already exists
|
|
usermod -u "$PUID" "$NPMUSER" || exit 1
|
|
else
|
|
# Add npm user
|
|
useradd -o -u "$PUID" -U -d "$NPMHOME" -s /bin/false "$NPMUSER" || exit 1
|
|
fi
|
|
|
|
usermod -G "$PGID" "$NPMUSER" || exit 1
|
|
groupmod -o -g "$PGID" "$NPMUSER" || exit 1
|
|
# Home for npm user
|
|
mkdir -p "$NPMHOME"
|
|
chown -R "$PUID:$PGID" "$NPMHOME"
|