Blame Scripts/Bash/initEnvironment.sh

4c79b5
#!/bin/bash
4c79b5
#
59b678
# initFunctions.sh -- Initializes environment variables and functions
59b678
# used by centos-art.sh scripts.
4c79b5
#
4c79b5
# Copyright (C) 2009-2010 Alain Reguera Delgado
4c79b5
# 
4c79b5
# This program is free software; you can redistribute it and/or modify
4c79b5
# it under the terms of the GNU General Public License as published by
4c79b5
# the Free Software Foundation; either version 2 of the License, or
4c79b5
# (at your option) any later version.
4c79b5
# 
4c79b5
# This program is distributed in the hope that it will be useful, but
4c79b5
# WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
4c79b5
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
4c79b5
# USA.
4c79b5
# 
4c79b5
# ----------------------------------------------------------------------
4c79b5
# $Id: initFunctions.sh 80 2010-09-18 06:57:26Z al $
4c79b5
# ----------------------------------------------------------------------
4c79b5
59b678
# Initizalize centos-art.sh gettext internazionalization.
4c79b5
. gettext.sh
4c79b5
export TEXTDOMAIN=centos-art.sh
4c79b5
export TEXTDOMAINDIR=/home/centos/artwork/trunk/Scripts/Bash/Locale
4c79b5
59b678
# Initialize centos-art.sh personal information.
59b678
export CLINAME='centos-art.sh'
59b678
export CLIVERSION='Beta'
dafe34
export CLIDESCRIP="`gettext "The CentOS Artwork Repository automation tool."`"
dafe34
export CLICOPYRIGHT="Copyright (C) 2009-2011 Alain Reguera Delgado"
59b678
59b678
# Initialize centos-art.sh function scripts.
4c79b5
FILES=$(ls /home/centos/artwork/trunk/Scripts/Bash/Functions/{cli,cli_*}.sh)
4c79b5
for FILE in $FILES;do
4c79b5
    if [[ -x $FILE ]];then
4c79b5
        . $FILE
4c79b5
        FUNCTION=$(grep '^function ' $FILE | cut -d' ' -f2)
4c79b5
        export -f $FUNCTION
4c79b5
    else
59b678
        echo `gettext "The $FILE needs to have execution rights."`
59b678
        exit
4c79b5
    fi
4c79b5
done
4c79b5
59b678
# Unset all variables not considered global in order to start cli
59b678
# execution with a clean environment.
4c79b5
unset FILE
4c79b5
unset FILES
4c79b5
unset FUNCTION