#!/bin/sh -e

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

    if [ -d /etc/nginx/conf.d ] && [ ! -f /etc/nginx/conf.d/zabbix.conf ] && [ ! -h /etc/nginx/conf.d/zabbix.conf ]; then
        ln -s /etc/zabbix/nginx.conf /etc/nginx/conf.d/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
