#!/bin/sh

for chroot in $(find /opt/ltsp/ -mindepth 1 -maxdepth 1 -type d) ; do
    if [ -f $chroot/var/lib/dpkg/status ]; then
        echo "packages in chroot: $chroot" >&3
        COLUMNS=120 dpkg --root=$chroot -l 'ltsp*' ldm | egrep 'ltsp-client|ldm|ltspfs' >&3
    fi
    if [ -f $chroot/etc/lts.conf ]; then
        echo "lts.conf from chroot: $chroot" >&3
        cat $chroot/etc/lts.conf >&3
    fi
done
if [ -d "/opt/ltsp/images" ]; then
    for image in $(find /opt/ltsp/images/ -type -f -name '*.img' ); do
        echo found image $image >&3
    done
fi
