#!/bin/sh

set -e

create_user() {
    if ! getent passwd nagios > /dev/null; then
        adduser --quiet --system --group --disabled-login \
            --home /var/lib/nagios nagios
    fi
}

case "$1" in
    configure)
        create_user
        ;;
    abort-upgrade|abort-remove|abort-deconfigure)
        ;;

    *)
        echo "postinst called with unknown argument '$1'" >&2
        exit 1
        ;;
esac

#DEBHELPER#
