HEX
Server: nginx/1.26.1
System: Linux main-vm 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
User: root (0)
PHP: 8.2.19
Disabled: NONE
Upload Files
File: //var/lib/dpkg/info/nginx.preinst
#! /bin/sh
# preinst script for nginx

set -e

addnginxuser() {
    # creating nginx group if he isn't already there
    if ! getent group nginx >/dev/null; then
        groupadd --system nginx >/dev/null
    fi

    # creating nginx user if he isn't already there
    if ! getent passwd nginx >/dev/null; then
        useradd \
          --system \
          --gid nginx \
          --no-create-home \
          --home /nonexistent \
          --comment "nginx user" \
          --shell /usr/sbin/nologin \
          nginx  >/dev/null
    fi
}

case "$1" in
    install)
        addnginxuser
        cat <<BANNER
----------------------------------------------------------------------

Thanks for using nginx!

Please find the official documentation for nginx here:
* https://nginx.org/en/docs/

Please subscribe to nginx-announce mailing list to get
the most important news about nginx:
* https://nginx.org/en/support.html

Commercial subscriptions for nginx are available on:
* https://nginx.com/products/

----------------------------------------------------------------------
BANNER
        ;;
    upgrade)
        addnginxuser
        ;;

    abort-upgrade)
        ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 0
        ;;
esac



exit 0