#!/bin/bash
#

p_nom=${0##*/}
p_projet=utilitaires
scripts_dir="/usr/share/eole/sbin"

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


    container_path_fichier=$(CreoleGet container_path_fichier)

    CHROOT=''
    [ ! "$container_path_fichier" = "" ] && CHROOT="chroot $container_path_fichier"

    echo "$p_nom: Il reste à mettre ou à remettre la machine dans le domaine"
    echo "$p_nom: Pour cela il est possible d'utiliser le script $scripts_dir/esbl_samba_join"

    ln -s -f $scripts_dir/esbl_samba_join $container_path_fichier/usr/bin/esbl_samba_join

    . /usr/lib/eole/ihm.sh
    Question_ouinon "Voulez joindre un domaine maintenant o/n ?" "True" "oui" "warn"
    rep=$(echo "$?")
    if [ "$rep" == "0" ]; then
        $CHROOT $scripts_dir/esbl_samba_join
    else
        EchoOrange "L'intégration du serveur au domaine s'effectuera plus tard avec la commande 'esbl_samba_join'"

    fi
fi

exit 0
