#!/bin/bash
###################### Include common files #######################
PVA_MN_CORE=1 #0
scriptDir=`dirname "$0"`
. ${scriptDir}/pva-agent-helper.sh || abort "Failed to include ${scriptDir}/pva-agent-helper.sh" 

############################### Go  ##############################
function upgradeDb()
{
	[ -d "${VZLCORE_SQL_DIR}" ] || return 1

	echo "# Upgrading DB"
	execSql ${VZLCORE_SQL_DIR}/mysql_45_46_upgrade.sql
}

echo "------------------------------------------------------------------------------------------------"
date "+%b %e %T PVA postupgrade configuration : start"

if [[ $PVA_MN_CORE == 1 ]]; then
	upgradeDb
fi
# Start services
start_vzagent_services
     
date "+%b %e %T PVA postupgrade configuration : stop"
echo "------------------------------------------------------------------------------------------------"

