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
8cbdc0
    local PREPARE_ACTIONNAM=''
8cbdc0
    local PREPARE_ACTIONNAMS=''
8e457b
38d53d
    # Define absolute path to directory holding prepare's
38d53d
    # configuration files.
8cbdc0
    local PREPARE_CONFIG_DIR=${FUNCDIR}/${FUNCDIRNAM}/Config
8e457b
8e457b
    # Interpret arguments and options passed through command-line.
8cbdc0
    ${FUNCNAM}_getOptions
4c79b5
8cbdc0
    # Execute action names based on whether they were provided or not.
8cbdc0
    if [[ $PREPARE_ACTIONNAMS == '' ]];then
8e457b
8cbdc0
        # When action names are not provided, define action names that
8cbdc0
        # will take place, explicitly.
8cbdc0
        ${FUNCNAM}_updatePackages
8cbdc0
        ${FUNCNAM}_updateLinks
8cbdc0
        ${FUNCNAM}_updateImages
8cbdc0
        ${FUNCNAM}_updateManuals
8cbdc0
8cbdc0
    else
8cbdc0
8cbdc0
        # When action names are provided, loop through them and
8cbdc0
        # execute them one by one.
8cbdc0
        for PREPARE_ACTIONNAM in $PREPARE_ACTIONNAMS;do
8cbdc0
            ${FUNCNAM}_${PREPARE_ACTIONNAM}
8cbdc0
        done
8cbdc0
8cbdc0
    fi
8e457b
4c79b5
}