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

# On désactive le service ipsec qui est géré par bastion
if [ -L /etc/rc3.d/S*ipsec ]
then
    update-rc.d -f ipsec remove >/dev/null
fi
install_rvp=$(CreoleGet install_rvp)
type_amon=$(CreoleGet type_amon '')
if [ "$install_rvp" = "non" ]
then
    # ipsec est inutile (#1937)
    /etc/init.d/ipsec stop &>/dev/null
elif [ "${type_amon}" != "" ]
then
    if [ "$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
