#!/bin/bash
###################### Include common files #######################

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

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

PVA_INSTALLED=1
PVA_VERSION=`rpm -q --qf "%{version}" pva-agent-core`
if [ $? -ne 0 ]; then
	PVA_VERSION=`rpm -q --qf "%{version}" pva-mn-core`
	if [ $? -ne 0 ]; then
		PVA_INSTALLED=0
	fi
fi

if [ ${PVA_INSTALLED} -eq 1 ]; then
	abort "You cannot upgrade from PVA ${PVA_VERSION}"
fi
