#!/bin/bash
#
# set -u

source /usr/share/Landscape/LandscapeCore/bin/get_values
export PATH="$PATH:$LandscapeIn/bin"

function configure_OS()
{
    local usc="$1"
    ( 
        # TODO - need to check return codes
        cd /usr/share/Landscape/LandscapeCore/automate-VMs; 
        ./automate-05-configure-ntp-dns --group="$usc";
        ./automate-07-configure-saptune --group="$usc";
    ) 
}

theGROUP=""

while [ $# -gt 0 ]; do
    case "$1" in
        --group=* ) theGROUP=${1#--group=}
                    ;;
    esac
    shift
done

if [ -z "$theGROUP" ]; then
    echo "Group of nodes needs to be set with option --group=<groupname>"
    exit 2
fi

configure_OS "$theGROUP"
