#!/bin/bash

if [ -z "$(CreoleGet ad_address "")" ];
then
    # Seth - AmonEcole
    gpo_script_path="/home/sysvol/$(CreoleGet ad_realm)/scripts/"
    #CreoleRun "apt install eole-ad-dc-gpos-pkg" addc #balise <package> dans dicos/98_gpo_container.xml
    CreoleRun "cp -rf /usr/share/eole/gpo/scripts/. ${gpo_script_path}" addc
elif [ "$(CreoleGet ad_local)" = "oui" ];
then
    # Scribe AD local
    gpo_script_path="/home/sysvol/$(CreoleGet ad_domain)/scripts/"
    #lxc-attach -n addc -- apt install eole-ad-dc-gpos-pkg #dependance de eole-ad-pkg (scribe-ad)
    lxc-attach -n addc -- cp -rf /usr/share/eole/gpo/scripts/. "${gpo_script_path}"
fi

exit 0
