Blame Automation/Modules/Prepare/prepare.sh

Alain Reguera Delgado 8f60cb
#!/bin/bash
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# prepare.sh (initialization) -- This function creates the base
Alain Reguera Delgado 8f60cb
# execution environment required to standardize final configuration
Alain Reguera Delgado 8f60cb
# stuff needed by your workstation, once the working copy of The
Alain Reguera Delgado 8f60cb
# CentOS Artwork Repository has been downloaded in it.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# Copyright (C) 2009-2013 The CentOS Project
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# This program is free software; you can redistribute it and/or modify
Alain Reguera Delgado 8f60cb
# it under the terms of the GNU General Public License as published by
Alain Reguera Delgado 8f60cb
# the Free Software Foundation; either version 2 of the License, or (at
Alain Reguera Delgado 8f60cb
# your option) any later version.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# This program is distributed in the hope that it will be useful, but
Alain Reguera Delgado 8f60cb
# WITHOUT ANY WARRANTY; without even the implied warranty of
Alain Reguera Delgado 8f60cb
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Alain Reguera Delgado 8f60cb
# General Public License for more details.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# You should have received a copy of the GNU General Public License
Alain Reguera Delgado 8f60cb
# along with this program; if not, write to the Free Software
Alain Reguera Delgado 8f60cb
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# ----------------------------------------------------------------------
Alain Reguera Delgado 8f60cb
# $Id$
Alain Reguera Delgado 8f60cb
# ----------------------------------------------------------------------
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
function prepare {
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 0de111
    echo 'Hi! I reached the "prepare" function.'
Alain Reguera Delgado 0de111
    exit
Alain Reguera Delgado 0de111
Alain Reguera Delgado 8f60cb
    local ACTIONNAM=''
Alain Reguera Delgado 8f60cb
    local ACTIONNAMS=''
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Define absolute path to directory holding prepare's
Alain Reguera Delgado 8f60cb
    # configuration files.
Alain Reguera Delgado 8f60cb
    local PREPARE_CONFIG_DIR=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/Config
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Interpret arguments and options passed through command-line.
Alain Reguera Delgado 8f60cb
    prepare_getOptions
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 0ba8c9
    # Redefine positional parameters using CLI_FUNCTION_ARGUMENTS. At
Alain Reguera Delgado 0ba8c9
    # this point, option arguments have been removed from
Alain Reguera Delgado 0ba8c9
    # CLI_FUNCTION_ARGUMENTS variable and only non-option arguments
Alain Reguera Delgado 0ba8c9
    # remain in it. 
Alain Reguera Delgado 0ba8c9
    eval set -- "$CLI_FUNCTION_ARGUMENTS"
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Execute action names based on whether they were provided or not.
Alain Reguera Delgado 8f60cb
    if [[ $ACTIONNAMS == '' ]];then
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
        # When action names are not provided, define action names that
Alain Reguera Delgado 8f60cb
        # will take place, explicitly.
Alain Reguera Delgado 8f60cb
        prepare_updateEnvironment
Alain Reguera Delgado 8f60cb
        prepare_updatePackages
Alain Reguera Delgado 8f60cb
        prepare_updateLocales
Alain Reguera Delgado 8f60cb
        prepare_updateLinks
Alain Reguera Delgado 8f60cb
        prepare_updateImages
Alain Reguera Delgado 8f60cb
        prepare_updateManuals
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    else
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
        # When action names are provided, loop through them and
Alain Reguera Delgado 8f60cb
        # execute them one by one.
Alain Reguera Delgado 8f60cb
        for ACTIONNAM in $ACTIONNAMS;do
Alain Reguera Delgado 8f60cb
            ${ACTIONNAM} $@
Alain Reguera Delgado 8f60cb
        done
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    fi
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
}