##############################################################################
# Copyright (c) Members of the EGEE Collaboration. 2004. 
# See http://www.eu-egee.org/partners/ for details on the copyright 
# holders.  
#
# Licensed under the Apache License, Version 2.0 (the "License"); 
# you may not use this file except in compliance with the License. 
# You may obtain a copy of the License at 
#
#    http://www.apache.org/licenses/LICENSE-2.0 
#
# Unless required by applicable law or agreed to in writing, software 
# distributed under the License is distributed on an "AS IS" BASIS, 
# WITHOUT WARRANTIES OR CONDITIONS 
# OF ANY KIND, either express or implied. 
# See the License for the specific language governing permissions and 
# limitations under the License.
##############################################################################
#
# NAME :        config_sysconfig_edg
#
# DESCRIPTION : This function configures the edg sysconfig.
#
# AUTHORS :     Robert.Harakaly@cern.ch
#
# NOTES :      
#
# YAIM MODULE:  glite-yaim-core
#                 
##############################################################################

config_sysconfig_edg(){

#INSTALL_ROOT=${INSTALL_ROOT:-/opt}

####@ Creates the ${GLITE_EXTERNAL_ROOT:-}/etc/sysconfig/ directory.

mkdir -p ${GLITE_EXTERNAL_ROOT:-}/etc/sysconfig/

####@ Writes the ${GLITE_EXTERNAL_ROOT:-}/etc/sysconfig/edg file with some default setting

cat <<EOF > ${GLITE_EXTERNAL_ROOT:-}/etc/sysconfig/edg
EDG_LOCATION=$YAIM_ROOT/edg
EDG_LOCATION_VAR=$YAIM_ROOT/edg/var
EDG_TMP=/tmp
X509_USER_CERT=${GLITE_EXTERNAL_ROOT:-}/etc/grid-security/hostcert.pem
X509_USER_KEY=${GLITE_EXTERNAL_ROOT:-}/etc/grid-security/hostkey.pem
GRIDMAP=${GLITE_EXTERNAL_ROOT:-}/etc/grid-security/grid-mapfile
GRIDMAPDIR=${GLITE_EXTERNAL_ROOT:-}/etc/grid-security/gridmapdir/
EOF

# no more needed for EMI
#EDG_WL_BKSERVERD_ADDOPTS=--rgmaexport
#EDG_WL_RGMA_FILE=${GLITE_EXTERNAL_ROOT:-}/var/edgwl/logging/status.log

return 0
}
