#!/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
else
    # Scribe
    gpo_script_path="/home/sysvol/$(CreoleGet ad_domain)/scripts/"
    lxc-attach -n addc -- apt install eole-ad-dc-gpos-pkg
    lxc-attach -n addc -- cp -rf /usr/share/eole/gpo/scripts/. "${gpo_script_path}"
fi

exit 0
