#!/bin/sh -e

if [ "$1" = "configure" ]; then
    if ! getent group zabbix > /dev/null 2>&1 ; then
        addgroup --system --quiet zabbix
    fi

    if ! getent passwd zabbix > /dev/null 2>&1 ; then
        adduser --quiet \
            --system --disabled-login --ingroup zabbix \
            --home /var/lib/zabbix/ --no-create-home \
            zabbix
    fi

    chown zabbix:zabbix /var/log/zabbix -R
fi

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
