#!/bin/sh

lp_path=/sys/class/usbmisc

if ! [ -d "$lp_path" ]; then
	exit
fi

cd $lp_path

for lps in `ls`; do
        desc_file=$lp_path/$lps/device/ieee1284_id
        uevent_file=$lp_path/$lps/device/uevent

        name=`cat $desc_file | sed 's/.*DES:\(.*\);.*/\1/' | cut -d ';' -f 1`
        model=`cat $desc_file | sed 's/.*MDL:\(.*\);.*/\1/' | cut -d ';' -f 1`
        product=`cat $uevent_file | grep PRODUCT= | sed 's/PRODUCT=\(.*\)/\1/'`

        echo $lps,$product,$model,$name;
done
