#!/bin/bash
# vmlist script, universal for LXC and OVZ
vmname=$1
if [[ -e /usr/sbin/vzctl ]]; then 
	vzctl enter $(vzlist -a | grep " $vmname" | awk '{print $1}')
elif [[ -e /usr/bin/lxctl ]]; then
	echo "Achtung! You will be _chrooted_ to LXC, due to buggy lxctl enter. Do not run any daemons, as they'll start at hw-node!" && chroot /var/lxc/root/$1/rootfs
else 
echo "It seems, that i am not OVZ or LXC host-node, check me, please."
fi
