#!/bin/bash
PVA_MN_CORE=0

scriptDir=`dirname "$0"`
. ${scriptDir}/pva-agent-helper.sh

function setup_vzaup2date()
{
	local e=
	local s=
	local b=vzup2date
	local f=/usr/sbin/$b
	local t=${VZLCORE_BIN_DIR}/$b
	local v=VZAUp2date.voc
	rm -f $t
	if [ -e $f ]; then
		`$f -h`
		if [ $? -ne 200 ]; then
			e=vzaup2date.engine.vzup2date
			s=$f
		fi
	fi
	if [ -z "$e" ]; then
		e=vzaup2date.engine.yum
		s=${t}.py
	fi
	ln -sf $s $t
	f=${VZLCORE_PLUGINS_DIR}/VZAUp2date/$v
	${VZLCORE_BIN_DIR}/vzlxmlman -i -s "$e" 'data/system/parameter[feature=engine]/id' $f 2>/dev/null
	e=( $(md5sum $f 2>/dev/null) )
	${VZLCORE_BIN_DIR}/vzlxmlman -i -s "\$Id: $v $(date -u) ${e[0]} \$" 'data/system/parameter[id=vocversion]/data' $f 2>/dev/null
	return 0
}

