#!/bin/sh -e

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

    if [ -d /etc/zabbix/web ]; then
       chown www-data.root /etc/zabbix/web
       chmod 755 /etc/zabbix/web
    fi

    for file in /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf; do
	if [ -e $file ]; then
            update-alternatives --install /usr/share/zabbix/assets/fonts/graphfont.ttf zabbix-frontend-font $file 10
	    break
	fi
    done

    for file in /etc/alternatives/ttf-japanese-gothic.ttf /etc/alternatives/fonts-japanese-gothic.ttf; do
        if [ -e $file ]; then
            update-alternatives --install /usr/share/zabbix/assets/fonts/graphfont.ttf zabbix-frontend-font $file 20
            break
        fi
    done

fi

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

#DEBHELPER#

exit 0
