- if [ ! -x "`which dpkg`" ]; then
- debug 2 "can't find dpkg, skipping installed packages report."
- packages="no"
+ if [ $usevserver ]
+ then
+ nodpkg="lost+found"
+ info "vserver root directory set to: $VROOTDIR"
+ for vserver in `ls $VROOTDIR |grep -v $nodpkg`
+ do
+ info "examining vserver: $vserver"
+ running=`vserver-info $vserver RUNNING`
+ if [ $running = 1 ]; then
+ if [ ! -x "`$VSERVER $vserver exec which dpkg`" ]; then
+ warning "can't find dpkg in vserver $vserver, skipping installed packages report."
+ nodpkg="$nodpkg $vserver"
+ fi
+ else
+ warning "vserver $vserver is not running, skipping installed packages report."
+ nodpkg="$nodpkg $vserver"
+ fi
+
+ done
+ else
+ if [ ! -x "`which dpkg`" ]; then
+ warning "can't find dpkg, skipping installed packages report."
+ packages="no"
+ fi