#!/bin/sh
# STTA Rev. 1.3 Copyright (c) 2001-2002 Jesús Pérez Lorenzo  --- license GNU GPL 

# Environment ...
lang="es";
is_STTA=true;

TTAHOME="/opt/tarantella"
TTA=$TTAHOME"/bin/tarantella"

STTA_defs="/opt/tarantella/defs"
STTA_oulist=ou_list
STTA_appslist=apps_list
STTA_grpappslist=grpapps_list
STTA_hostslist=hosts_list
STTA_grphostslist=grphosts_list
STTA_domainslist=domain_list
STTA_linklist=link_list

case "$lang" in 
   es|ES)
          msg_name="Nombre"
          msg_alias="Alias"
          msg_default="Por defecto"
          msg_dbcreate="Creando Base de Datos"
          msg_sttaFiles="Creando Definiciones de Grupos"
          msg_orgname="Nombre de la Organizacion: "
          msg_linkname="Grupo de Links parala Organizacion: "
          msg_usergrp=" USUARIOS de la Organizacion:"
          msg_hostsgrp="Grupo (ou) para SERVIDORES de la Organizacion:"
          msg_appsgrp="Grupo (ou) para APLICACIONES de la Organizacion:"
          msg_rootOrg="Organizacion"
          msg_startupGrp="Grupo RAIZ"
          ;;       
   *) 
          msg_name="Name"
          msg_alias="Alias"
          msg_default="by default"
          msg_dbcreate="Making Data Base"
          msg_sttaFiles="Making Group Definitions"
          msg_orgname="Organization Name: "
          msg_linkname="Organization Links: "
          msg_usergrp=" Organization USERS:"
          msg_hostsgrp="Organization SERVERS Group (ou):"
          msg_appsgrp="Organization APPLICATIONS Group (ou):"
          msg_rootOrg="Root Organization"
          msg_startupGrp="Start-up group"
          ;;       
esac

CreateGroups() {
  echo "$msg_sttaFiles $msg_default ..."
  echo "BASE::$msg_rootOrg::::::9999::$msg_startupGrp::" >$STTA_defs/$STTA_oulist
  echo "BASE::$msg_rootOrg::::::9999::$msg_startupGrp::" >$STTA_defs/$STTA_grpappslist
  echo "BASE::$msg_rootOrg::::::9999::$msg_startupGrp::" >$STTA_defs/$STTA_grphostslist
  echo "BASE::$msg_rootOrg::::::9999::$msg_startupGrp::" >$STTA_defs/$STTA_domainslist
  echo "BASE::$msg_rootOrg::::::9999::$msg_startupGrp::" >$STTA_defs/$STTA_linklist
}


$TTAHOME/tta_ens_recreate.sh
[ "$?" gt 0 ] && exit 1

CreateOrg

if [ "$is_STTA" eq true ] : then
     CreateGroups
fi 
