#!/bin/bash

PVA_MN_CORE=0

function checkPrerequisites()
{
	echo "Checking for Parallels Server presence"

	HARDWARE_PLATFORM=$(uname -i)

	if [[ "${HARDWARE_PLATFORM}" == "x86_64" ]]; then
		MSG=`cat /etc/redhat-release`
		if [[ "$MSG" == "Parallels Server Bare Metal 3.0.0" ]]; then
			echo "Parallels Server (Bare Metal) is installed"
		else
			abort "Parallels Server (Bare Metal) is not installed: '$MSG'"
		fi
	else
		MSG=`whereis -b prlctl | awk '{print$2}'`
		if test -f "$MSG"; then
			echo Parallels Server is installed
		else
			abort "Parallels Server is not installed"
		fi
	fi
}

function main() 
{
    echo "------------------------------------------------------------------------------------------------"
    date "+%b %e %T PVA Agent for Parallels Server pre install configuration : start"

    checkPrerequisites

    date "+%b %e %T PVA Agent for Parallels Server pre install configuration : stop"
    echo "------------------------------------------------------------------------------------------------"
}

###################### Include common files #######################

# VZL defines
scriptDir=`dirname "$0"`
# VZL defines
. ${scriptDir}/pva-agent-helper.sh || abort "Failed to include ${scriptDir}/pva-agent-helper.sh" 

############################### Go  ##############################

main $*

exit 0
