| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_getActions { |
| |
| |
| local ACTIONDIR='' |
| local ACTIONFILES='' |
| local ACTIONSCRIPT='' |
| local ACTIONFUN='' |
| local REPOFUNDIR='' |
| |
| |
| |
| REPOFUNDIR=/home/centos/artwork/trunk/Scripts/Bash/Functions |
| |
| |
| ACTIONDIR=$(cli_getRepoName 'd' $ACTION) |
| |
| |
| ACTIONSCRIPT=${REPOFUNDIR}/${ACTIONDIR}/${ACTION}.sh |
| |
| |
| if [[ ! -f $ACTIONSCRIPT ]];then |
| cli_printMessage "`gettext "The action provided is not valid."`" |
| cli_printMessage "$(caller)" "AsToKnowMoreLine" |
| fi |
| |
| |
| ACTIONFILES=$(ls ${REPOFUNDIR}/${ACTIONDIR}/${ACTION}*.sh) |
| |
| for FILE in $ACTIONFILES;do |
| |
| if [[ -x ${FILE} ]];then |
| |
| |
| . $FILE |
| |
| |
| |
| ACTIONFUN=$(grep '^function ' $FILE | cut -d' ' -f2) |
| export -f $ACTIONFUN |
| |
| else |
| |
| cli_printMessage "`eval_gettext "The \\\$FILE hasn't execution rights."`" |
| cli_printMessage "$(caller)" "AsToKnowMoreLine" |
| |
| fi |
| |
| done |
| |
| # Execute action passed to centos-art.sh script. |
| eval $ACTION |
| |
| } |
| |