Blame Scripts/Functions/Prepare/prepare.sh

4c79b5
#!/bin/bash
4c79b5
#
b7c1a7
# prepare.sh (initialization) -- This function creates the base
b7c1a7
# execution environment required to standardize final configuration
b7c1a7
# stuff needed by your workstation, once the working copy of The
b7c1a7
# CentOS Artwork Repository has been downloaded in it.
4c79b5
#
3b0984
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
dcd347
# the Free Software Foundation; either version 2 of the License, or (at
dcd347
# your option) any later version.
fa95b1
#
74a058
# This program is distributed in the hope that it will be useful, but
74a058
# 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
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7ac5a5
#
4c79b5
# ----------------------------------------------------------------------
3b853a
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
111205
function prepare {
4c79b5
a7f694
    local ACTIONNAM=''
a7f694
    local ACTIONNAMS=''
8e457b
38d53d
    # Define absolute path to directory holding prepare's
38d53d
    # configuration files.
49f245
    local CONFIGDIR=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/Config
8e457b
8e457b
    # Interpret arguments and options passed through command-line.
5a5b08
    ${CLI_FUNCNAME}_getOptions
4c79b5
8cbdc0
    # Execute action names based on whether they were provided or not.
a7f694
    if [[ $ACTIONNAMS == '' ]];then
8e457b
8cbdc0
        # When action names are not provided, define action names that
8cbdc0
        # will take place, explicitly.
5a5b08
        ${CLI_FUNCNAME}_updatePackages
5a5b08
        ${CLI_FUNCNAME}_updateLinks
5a5b08
        ${CLI_FUNCNAME}_updateImages
5a5b08
        ${CLI_FUNCNAME}_updateManuals
8cbdc0
8cbdc0
    else
8cbdc0
8cbdc0
        # When action names are provided, loop through them and
8cbdc0
        # execute them one by one.
a7f694
        for ACTIONNAM in $ACTIONNAMS;do
5a5b08
            ${CLI_FUNCNAME}_${ACTIONNAM}
8cbdc0
        done
8cbdc0
8cbdc0
    fi
8e457b
4c79b5
}