#!/bin/bash
. /usr/lib/eole/ihm.sh
type_amon=$(CreoleGet type_amon 2>/dev/null)
# Dans le cadre d'Amon, c'est le service rvp qui gère ipsec
if [ "${type_amon}" != "" ]
then
    install_rvp=$(CreoleGet install_rvp)
    if [ -L /etc/rc3.d/S20ipsec ]
    then
            update-rc.d -f ipsec remove >/dev/null
    fi

    if [ "$install_rvp" = "non" ]
    then
        # ipsec est inutile (#1937)
        /etc/init.d/ipsec stop &>/dev/null
    elif [ "$1" = "instance" ]
    then
        ## Mise en place du VPN ##
        echo
        Question_ouinon "Voulez-vous (re)configurer le Réseau Virtuel Privé maintenant ?" "True" "non"
        if [ $? -eq 0 ];then
            /usr/share/eole/sbin/active_rvp init
        fi
        echo
    fi
fi

exit 0
