#!/bin/bash
# Copyright (C) Parallels IP Holdings GmbH, 1999-2014. All rights reserved.
#
# This script clean CT resources on stop event
#

eval $(. /etc/vz/vz.conf && echo LOCKDIR="${LOCKDIR}")
lckfile=$LOCKDIR/$ID.lck
if [ -f "$lckfile" ]; then
	pid=`head -n1 $lckfile`
	[ -n "$pid" -a -e "/proc/$pid" ] && exit 0
fi

/usr/sbin/vzctl stop $ID --force >/dev/null 2>&1

