#!/bin/bash
if [[ ! "$(CreoleGet type_squid_auth aucun)" =~ 'NTLM' ]]; then
    # Winbind ne supprime pas son fichier PID en s'arrêtant
    # Cela pose un problème lors du logrotate #21577
    CreoleRun "rm -f /var/run/samba/winbindd.pid" proxy
fi
if [ "$1" = "instance" ];then
    . /usr/lib/eole/ihm.sh
    #enregistrement au domaine dans le cas du NTLM
    if [[ "$(CreoleGet type_squid_auth aucun)" =~ 'NTLM' ]]; then
        Question_ouinon "Voulez-vous (ré)intégrer le serveur au domaine maintenant ?" "True" "oui"
        if [ $? -eq 0 ];then
            /usr/share/eole/sbin/enregistrement_domaine.sh
            [ $? -ne 0 ] && exit 1
        fi
    fi
    echo
    if [ $(CreoleGet activer_filtrage_proxy) = 'oui' ];then
        Question_ouinon "Voulez-vous mettre à jour les bases de filtrage maintenant ?" 'True' "oui"
        if [ $? -eq 0 ];then
            /usr/share/eole/sbin/Maj-blacklist.sh
        fi
        echo
    fi
    if [ $(CreoleGet proxy_download_bypass non) = 'oui' ];then
        Question_ouinon "Voulez-vous mettre à jour les bases des exceptions maintenant ?" 'True' "oui"
        if [ $? -eq 0 ];then
            /usr/share/eole/sbin/Maj-exceptions.sh
        fi
        echo
    fi
fi
exit 0
