cd /var/lib/vz/root/
for d in * ; do
if test -d "$d/var/lib/apt"; then
chroot "$d" apt-get -y update
chroot "$d" apt-get -y dist-upgrade
elif test -d "$d/var/lib/yum"; then
chroot "$d" yum -y upgrade
else
echo "ERROR: unknown packaging system in CT $d"
fi