#!/bin/sh -e

if [ "$1" = "configure" ]; then

    if [ -d /etc/lighttpd/conf-available ] && [ ! -f /etc/lighttpd/conf-available/50-zabbix.conf ] && [ ! -h /etc/lighttpd/conf-available/50-zabbix.conf ]; then
        ln -s /etc/zabbix/web/lighttpd.conf /etc/lighttpd/conf-available/50-zabbix.conf
    fi

    # process multiple php versions
    for dir in $(realpath /etc/php/*/fpm/pool.d); do
        if [ ! -e "$dir/zabbix-php-fpm.conf" ]; then
            ln -sf /etc/zabbix/web/php-fpm.conf "$dir/zabbix-php-fpm.conf"
        fi
    done
fi

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

#DEBHELPER#

exit 0
