#!/bin/bash
. /usr/lib/eole/utils.sh

adresse_ip_tftp="$(CreoleGet adresse_ip_tftp '')"
if [ -n "$adresse_ip_tftp" ];then
    if [ "$adresse_ip_tftp" = "$(CreoleGet adresse_ip_eth0)" ] ||
       [ "$adresse_ip_tftp" = "$(CreoleGet adresse_ip_fichier_link '')" ];then
        enable_service 'tftpd-hpa' 'dhcp'
    else
        disable_service 'tftpd-hpa' 'dhcp'
    fi
else
    disable_service 'tftpd-hpa' 'dhcp'
fi

exit 0
