#!/bin/bash

PVA_MN_CORE=0

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

# Stopping PVA agent
pvaagent stop

# Create "/vz/backups directory"
mkdir -p /vz/backups || abort "Can't create backup storage directory"

# Create links in old vzagent directory required for vzreport utility
mkdir -p /opt/vzagent/bin
ln -sf ${VZLCORE_BIN_DIR}/vzagentInfoReport.sh /opt/vzagent/bin/vzagentInfoReport.sh
ln -sf ${VZLCORE_BIN_DIR}/vzagentCollectReport.sh /opt/vzagent/bin/vzagentCollectReport.sh

# Create links in old vzagent directory required for repair containers
mkdir -p /var/vzagent/etc
ln -sf ${VZLCORE_ETC_DIR}/repair /var/vzagent/etc/repair

# Starting PVA agent
pvaagent start

