#!/bin/sh

# This constant is replaced by the build system. In the result script this bool value will reflect 
# the configfuration of the PVA core. If PVA_MN_CORE is 1, then we work for PVA management node core,
# otherwise the core we deal with is for slave agent.    
PVA_MN_CORE=0 # 1

if [ 0 -eq $PVA_MN_CORE ]; then
	. /opt/pva/agent/install/etc/vzl_defines
else
	. /opt/pva/mn/install/etc/vzl_defines
fi

if [ -n "$VZLCORE_LOG_DIR" ]; then
	a=5
	find $VZLCORE_LOG_DIR -maxdepth 1 -name \*-vzagent.log -type f | sort -r | tail -n +$((a + 1)) | xargs rm -f
fi

