Blame Scripts/Bash/Functions/Commons/cli_runFnEnvironment.sh

35aa00
#!/bin/bash
35aa00
#
35aa00
# cli_runFnEnvironment.sh -- This function standardizes the way
35aa00
# centos-art.sh script is called to itself. The main purpose of this
35aa00
# somehow own interface is to control the parent script flow based on
35aa00
# specific function environments exit status.
35aa00
#
35aa00
# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project
35aa00
#
35aa00
# This program is free software; you can redistribute it and/or modify
35aa00
# it under the terms of the GNU General Public License as published by
35aa00
# the Free Software Foundation; either version 2 of the License, or (at
35aa00
# your option) any later version.
35aa00
#
35aa00
# This program is distributed in the hope that it will be useful, but
35aa00
# WITHOUT ANY WARRANTY; without even the implied warranty of
35aa00
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
35aa00
# General Public License for more details.
35aa00
#
35aa00
# You should have received a copy of the GNU General Public License
35aa00
# along with this program; if not, write to the Free Software
35aa00
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35aa00
#
35aa00
# ----------------------------------------------------------------------
35aa00
# $Id$
35aa00
# ----------------------------------------------------------------------
35aa00
35aa00
function cli_runFnEnvironment {
35aa00
35aa00
    # Execute specific function environment.
35aa00
    ${CLI_NAME} $@
35aa00
35aa00
    # Retrieve exit status.
35aa00
    local STATUS=$?
35aa00
35aa00
    # Finish script execution based on exit status.
35aa00
    if [[ ${STATUS} -eq 1 ]];then
35aa00
        exit ${STATUS}
35aa00
    fi
35aa00
35aa00
}