59b678
Update initFunctions.sh and cli.sh scripts.
@@ -34,16 +34,6 @@ function cli {
|
|
34
34
|
local ACTIONVAL=''
|
35
35
|
local REGEX=''
|
36
36
|
local ARGUMENTS=''
|
37
|
-
local CLINAME=''
|
38
|
-
local CLIVERSION=''
|
39
|
-
local CLIDESCRIP=''
|
40
|
-
local CLICOPYRIGHT=''
|
41
|
-
|
42
|
-
# Define centos-art.sh script personal information.
|
43
|
-
CLINAME='centos-art.sh'
|
44
|
-
CLIVERSION='Beta'
|
45
|
-
CLIDESCRIP="`gettext "Automate frequent tasks inside CentOS Artwork Repository."`"
|
46
|
-
CLICOPYRIGHT="Copyright (C) 2009, 2010 Alain Reguera Delgado"
|
47
37
|
|
48
38
|
# Redefine positional parameters stored inside ARGUMENTS variable.
|
49
39
|
cli_doParseArgumentsReDef "$@"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
#
|
3
|
-
# initFunctions.sh -- Initializes
|
4
|
-
#
|
3
|
+
# initFunctions.sh -- Initializes environment variables and functions
|
4
|
+
# used by centos-art.sh scripts.
|
5
5
|
#
|
6
6
|
# Copyright (C) 2009-2010 Alain Reguera Delgado
|
7
7
|
#
|
@@ -24,35 +24,32 @@
|
|
24
24
|
# $Id: initFunctions.sh 80 2010-09-18 06:57:26Z al $
|
25
25
|
# ----------------------------------------------------------------------
|
26
26
|
|
27
|
-
# Initizalize gettext internazionalization.
|
27
|
+
# Initizalize centos-art.sh gettext internazionalization.
|
28
28
|
. gettext.sh
|
29
29
|
export TEXTDOMAIN=centos-art.sh
|
30
30
|
export TEXTDOMAINDIR=/home/centos/artwork/trunk/Scripts/Bash/Locale
|
31
31
|
|
32
|
-
# Initialize centos-art.sh
|
32
|
+
# Initialize centos-art.sh personal information.
|
33
|
+
export CLINAME='centos-art.sh'
|
34
|
+
export CLIVERSION='Beta'
|
35
|
+
export CLIDESCRIP="`gettext "Automate frequent tasks inside CentOS Artwork Repository."`"
|
36
|
+
export CLICOPYRIGHT="Copyright (C) 2009-2010 Alain Reguera Delgado"
|
37
|
+
|
38
|
+
# Initialize centos-art.sh function scripts.
|
33
39
|
FILES=$(ls /home/centos/artwork/trunk/Scripts/Bash/Functions/{cli,cli_*}.sh)
|
34
|
-
MISSINGFILES=''
|
35
40
|
for FILE in $FILES;do
|
36
41
|
if [[ -x $FILE ]];then
|
37
42
|
. $FILE
|
38
43
|
FUNCTION=$(grep '^function ' $FILE | cut -d' ' -f2)
|
39
44
|
export -f $FUNCTION
|
40
45
|
else
|
41
|
-
|
46
|
+
echo `gettext "The $FILE needs to have execution rights."`
|
47
|
+
exit
|
42
48
|
fi
|
43
49
|
done
|
44
50
|
|
45
|
-
|
46
|
-
|
51
|
+
# Unset all variables not considered global in order to start cli
|
52
|
+
# execution with a clean environment.
|
47
|
-
echo `gettext "The $FILE needs to have execution rights."`
|
48
|
-
done
|
49
|
-
exit
|
50
|
-
fi
|
51
|
-
|
52
|
-
# Unset all except gettext's initialization variables in order to
|
53
|
-
# start cli execution with a clean environment. Only gettext's
|
54
|
-
# initialization variables are required to pass.
|
55
53
|
unset FILE
|
56
54
|
unset FILES
|
57
|
-
unset MISSINGFILES
|
58
55
|
unset FUNCTION
|